public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes.
@ 2011-01-09 18:28 hubicka at gcc dot gnu.org
  2011-01-11 13:03 ` [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-09 18:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

           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.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local API changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
@ 2011-01-11 13:03 ` rguenth at gcc dot gnu.org
  2011-01-26 10:23 ` [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes hubicka at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-11 13:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
  2011-01-11 13:03 ` [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] " rguenth at gcc dot gnu.org
@ 2011-01-26 10:23 ` hubicka at gcc dot gnu.org
  2011-01-26 14:29 ` hubicka at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-26 10:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

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.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
  2011-01-11 13:03 ` [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] " rguenth at gcc dot gnu.org
  2011-01-26 10:23 ` [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes hubicka at gcc dot gnu.org
@ 2011-01-26 14:29 ` hubicka at gcc dot gnu.org
  2011-01-26 14:45 ` hjl.tools at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-26 14:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

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&rev=169290
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&rev=169291
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?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-01-26 14:29 ` hubicka at gcc dot gnu.org
@ 2011-01-26 14:45 ` hjl.tools at gmail dot com
  2011-01-27  7:03 ` [Bug tree-optimization/47237] [4.3/4.4/4.5 " hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-26 14:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

--- 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.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.3/4.4/4.5 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-01-26 14:45 ` hjl.tools at gmail dot com
@ 2011-01-27  7:03 ` hjl.tools at gmail dot com
  2011-02-02 18:00 ` dnovillo at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-27  7:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED
      Known to work|                            |4.6.0
            Summary|[4.3/4.4/4.5/4.6            |[4.3/4.4/4.5 Regression]
                   |Regression]                 |builtin_apply_args broken
                   |builtin_apply_args broken   |WRT local ABI changes.
                   |WRT local ABI changes.      |

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-27 05:13:46 UTC ---
Fixed on trunk so far.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.3/4.4/4.5 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-01-27  7:03 ` [Bug tree-optimization/47237] [4.3/4.4/4.5 " hjl.tools at gmail dot com
@ 2011-02-02 18:00 ` dnovillo at gcc dot gnu.org
  2011-02-02 18:01 ` dnovillo at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu.org @ 2011-02-02 18:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

--- Comment #8 from Diego Novillo <dnovillo at gcc dot gnu.org> 2011-02-02 17:53:23 UTC ---
Author: dnovillo
Date: Wed Feb  2 17:53:17 2011
New Revision: 169620

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169620
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:
    branches/google/integration/gcc/ChangeLog
    branches/google/integration/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.3/4.4/4.5 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-02-02 18:00 ` dnovillo at gcc dot gnu.org
@ 2011-02-02 18:01 ` dnovillo at gcc dot gnu.org
  2011-06-27 14:38 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu.org @ 2011-02-02 18:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

--- Comment #7 from Diego Novillo <dnovillo at gcc dot gnu.org> 2011-02-02 17:53:16 UTC ---
Author: dnovillo
Date: Wed Feb  2 17:53:08 2011
New Revision: 169619

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169619
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:
    branches/google/integration/gcc/testsuite/gcc.c-torture/execute/pr47237.c
Modified:
    branches/google/integration/gcc/cgraph.c
    branches/google/integration/gcc/cgraph.h
    branches/google/integration/gcc/cgraphunit.c
    branches/google/integration/gcc/config/i386/i386.c
    branches/google/integration/gcc/ipa-cp.c
    branches/google/integration/gcc/ipa-inline.c
    branches/google/integration/gcc/ipa-split.c
    branches/google/integration/gcc/lto-cgraph.c
    branches/google/integration/gcc/tree-sra.c


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.3/4.4/4.5 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-02-02 18:01 ` dnovillo at gcc dot gnu.org
@ 2011-06-27 14:38 ` rguenth at gcc dot gnu.org
  2012-03-13 15:12 ` [Bug tree-optimization/47237] [4.5 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-27 14:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.6                       |4.4.7

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-27 12:14:19 UTC ---
4.3 branch is being closed, moving to 4.4.7 target.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.5 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-06-27 14:38 ` rguenth at gcc dot gnu.org
@ 2012-03-13 15:12 ` jakub at gcc dot gnu.org
  2012-03-24 23:41 ` hubicka at gcc dot gnu.org
  2012-07-02 10:24 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-13 15:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.7                       |4.5.4

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-13 12:47:46 UTC ---
4.4 branch is being closed, moving to 4.5.4 target.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.5 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2012-03-13 15:12 ` [Bug tree-optimization/47237] [4.5 " jakub at gcc dot gnu.org
@ 2012-03-24 23:41 ` hubicka at gcc dot gnu.org
  2012-07-02 10:24 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-03-24 23:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

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

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

--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-03-24 22:10:10 UTC ---
I have no plans on backport at the moment.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug tree-optimization/47237] [4.5 Regression] builtin_apply_args broken WRT local ABI changes.
  2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2012-03-24 23:41 ` hubicka at gcc dot gnu.org
@ 2012-07-02 10:24 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 10:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47237

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.5.4                       |4.6.0

--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 10:23:23 UTC ---
Fixed in 4.6.0, the 4.5 branch is being closed.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-07-02 10:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-09 18:28 [Bug tree-optimization/47237] New: builtin_apply_args broken WRT local API changes hubicka at gcc dot gnu.org
2011-01-11 13:03 ` [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] " rguenth at gcc dot gnu.org
2011-01-26 10:23 ` [Bug tree-optimization/47237] [4.3/4.4/4.5/4.6 Regression] builtin_apply_args broken WRT local ABI changes hubicka at gcc dot gnu.org
2011-01-26 14:29 ` hubicka at gcc dot gnu.org
2011-01-26 14:45 ` hjl.tools at gmail dot com
2011-01-27  7:03 ` [Bug tree-optimization/47237] [4.3/4.4/4.5 " hjl.tools at gmail dot com
2011-02-02 18:00 ` dnovillo at gcc dot gnu.org
2011-02-02 18:01 ` dnovillo at gcc dot gnu.org
2011-06-27 14:38 ` rguenth at gcc dot gnu.org
2012-03-13 15:12 ` [Bug tree-optimization/47237] [4.5 " jakub at gcc dot gnu.org
2012-03-24 23:41 ` hubicka at gcc dot gnu.org
2012-07-02 10:24 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).