🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: gmane.comp.gcc.bugs
5 messages
5 total messages Started by "hubicka at gcc Sun, 09 Jan 2011 18:22
[Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes.
#305995
Author: "hubicka at gcc
Date: Sun, 09 Jan 2011 18:22
48 lines
1199 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG237

           Summary: builtin_apply_args broken WRT local API changes.
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hubicka@gcc.gnu.org


#define INTEGER_ARG  5

extern void abort(void);

static void foo(int arg)
{
  if (arg != INTEGER_ARG)
    abort();
}

static void bar(int arg)
{
  foo(arg);
  __builtin_apply(foo, __builtin_apply_args(), 16);
}

int main(void)
{
  bar(INTEGER_ARG);

  return 0;
}
fails at 32bit.  The problem is that we call bar with register calling
conventions, while foo's calling conventions are default.
We must prevent any call conventions changes on functions calling
builtlin_apply.

This is not only case where builtin_apply_args breaks, since we will happily
clone the functions, too.

I guess in addition to inlinable and cloning flag, we need flag whether
function calling convention can change. In what conditions this is false in
addition to apply_args?

This bug probably exists since GCC 3.4. I tested 4.3 and 4.5 to fail.
[Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local API changes.
#306194
Author: "rguenth at gcc
Date: Tue, 11 Jan 2011 12:59
12 lines
579 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG237

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
           Priority|P3                          |P2
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.01.11 12:59:31
   Target Milestone|---                         |4.3.6
     Ever Confirmed|0                           |1
[Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes.
#307947
Author: "hubicka at gcc
Date: Wed, 26 Jan 2011 10:06
12 lines
523 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG237

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |hubicka at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-26 10:06:05 UTC ---
testing patch.
[Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes.
#307979
Author: "hubicka at gcc
Date: Wed, 26 Jan 2011 14:17
84 lines
3369 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG237

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-26 14:06:23 UTC ---
Author: hubicka
Date: Wed Jan 26 14:06:20 2011
New Revision: 169290

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev9290
Log:
    PR target/47237
    * cgraph.h (cgraph_local_info): New field can_change_signature.
    * ipa-cp.c (ipcp_update_callgraph): Only compute args_to_skip if callee
    signature can change.
    (ipcp_estimate_growth): Call sequence simplify only if calle signature
    can change.
    (ipcp_insert_stage): Only compute args_to_skip if signature can change.
    (cgraph_function_versioning): We can not change signature of functions
    that don't allow that.
    * lto-cgraph.c (lto_output_node): Stream local.can_change_signature.
    (lto_input_node): Likewise.
    * ipa-inline.c (compute_inline_parameters): Compute
local.can_change_signature.
    * ipa-split.c (visit_bb): Never split away APPLY_ARGS.
    * tree-sra.c (ipa_sra_preliminary_function_checks): Give up on functions
    that can not change signature.
    * i386.c (ix86_function_regparm, ix86_function_sseregparm,
    init_cumulative_args): Do not use local calling conventions for functions
    that can not change signature.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr47237.c
Modified:
    trunk/gcc/cgraph.c
    trunk/gcc/cgraph.h
    trunk/gcc/cgraphunit.c
    trunk/gcc/config/i386/i386.c
    trunk/gcc/ipa-cp.c
    trunk/gcc/ipa-inline.c
    trunk/gcc/ipa-split.c
    trunk/gcc/lto-cgraph.c
    trunk/gcc/tree-sra.c

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-26 14:07:05 UTC ---
Author: hubicka
Date: Wed Jan 26 14:07:02 2011
New Revision: 169291

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev9291
Log:
    PR target/47237
    * gcc.c-torture/execute/pr47237.c: New testcase.

    * cgraph.h (cgraph_local_info): New field can_change_signature.
    * ipa-cp.c (ipcp_update_callgraph): Only compute args_to_skip if callee
    signature can change.
    (ipcp_estimate_growth): Call sequence simplify only if calle signature
    can change.
    (ipcp_insert_stage): Only compute args_to_skip if signature can change.
    (cgraph_function_versioning): We can not change signature of functions
    that don't allow that.
    * lto-cgraph.c (lto_output_node): Stream local.can_change_signature.
    (lto_input_node): Likewise.
    * ipa-inline.c (compute_inline_parameters): Compute
local.can_change_signature.
    * ipa-split.c (visit_bb): Never split away APPLY_ARGS.
    * tree-sra.c (ipa_sra_preliminary_function_checks): Give up on functions
    that can not change signature.
    * i386.c (ix86_function_regparm, ix86_function_sseregparm,
    init_cumulative_args): Do not use local calling conventions for functions
    that can not change signature.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-26 14:17:28 UTC ---
I've commited patch fixing the testcase. H.J., can you please confirm that the
LTO 32bit faiulres are gone for  you?
[Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes.
#307982
Author: "hjl.tools at gm
Date: Wed, 26 Jan 2011 14:26
8 lines
289 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG237

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-26 14:26:08 UTC ---
(In reply to comment #4)
> I've commited patch fixing the testcase. H.J., can you please confirm that the
> LTO 32bit faiulres are gone for  you?

Sure.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads