[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-11-25 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Martin Jambor jamborm at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #19 from Martin Jambor jamborm at gcc dot gnu.org ---
I believe this has been fixed.  Thanks a lot by the way.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-10-30 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.9.2   |4.9.3

--- Comment #18 from Jakub Jelinek jakub at gcc dot gnu.org ---
GCC 4.9.2 has been released.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-08-20 Thread wmi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #16 from wmi at gcc dot gnu.org ---
Author: wmi
Date: Wed Aug 20 16:47:12 2014
New Revision: 214233

URL: https://gcc.gnu.org/viewcvs?rev=214233root=gccview=rev
Log:
2014-08-20  Martin Jambor  mjam...@suse.cz
Wei Mi  w...@google.com

PR ipa/60449
PR middle-end/61776
* tree-ssa-operands.c (update_stmt_operands): Remove
MODIFIED_NORETURN_CALLS.
* tree-cfgcleanup.c (cleanup_call_ctrl_altering_flag): New func.
(cleanup_control_flow_bb): Use cleanup_call_ctrl_altering_flag.
(split_bb_on_noreturn_calls): Renamed from split_bbs_on_noreturn_calls.
(cleanup_tree_cfg_1): Use split_bb_on_noreturn_calls.
* tree-ssanames.h: Remove MODIFIED_NORETURN_CALLS.
* gimple.h (enum gf_mask): Add GF_CALL_CTRL_ALTERING.
(gimple_call_set_ctrl_altering): New func.
(gimple_call_ctrl_altering_p): Ditto.
* tree-cfg.c (gimple_call_initialize_ctrl_altering): Ditto.
(make_blocks): Use gimple_call_initialize_ctrl_altering.
(is_ctrl_altering_stmt): Use gimple_call_ctrl_altering_p.
(execute_fixup_cfg): Use gimple_call_ctrl_altering_p and
remove MODIFIED_NORETURN_CALLS.

2014-08-20  Martin Jambor  mjam...@suse.cz
Wei Mi  w...@google.com

PR ipa/60449
PR middle-end/61776
* testsuite/gcc.dg/lto/pr60449_1.c: New test.
* testsuite/gcc.dg/lto/pr60449_0.c: New test.
* testsuite/gcc.dg/pr61776.c: New test.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-cfg.c
trunk/gcc/tree-cfgcleanup.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssanames.h


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-08-20 Thread wmi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #17 from wmi at gcc dot gnu.org ---
Author: wmi
Date: Wed Aug 20 17:09:25 2014
New Revision: 214237

URL: https://gcc.gnu.org/viewcvs?rev=214237root=gccview=rev
Log:
2014-08-20  Martin Jambor  mjam...@suse.cz
Wei Mi  w...@google.com

PR ipa/60449
PR middle-end/61776
* tree-ssa-operands.c (update_stmt_operands): Remove
MODIFIED_NORETURN_CALLS.
* tree-cfgcleanup.c (cleanup_call_ctrl_altering_flag): New func.
(cleanup_control_flow_bb): Use cleanup_call_ctrl_altering_flag.
(split_bb_on_noreturn_calls): Renamed from split_bbs_on_noreturn_calls.
(cleanup_tree_cfg_1): Use split_bb_on_noreturn_calls.
* tree-ssanames.h: Remove MODIFIED_NORETURN_CALLS.
* gimple.h (enum gf_mask): Add GF_CALL_CTRL_ALTERING.
(gimple_call_set_ctrl_altering): New func.
(gimple_call_ctrl_altering_p): Ditto.
* tree-cfg.c (gimple_call_initialize_ctrl_altering): Ditto.
(make_blocks): Use gimple_call_initialize_ctrl_altering.
(is_ctrl_altering_stmt): Use gimple_call_ctrl_altering_p.
(execute_fixup_cfg): Use gimple_call_ctrl_altering_p and
remove MODIFIED_NORETURN_CALLS.

2014-08-20  Martin Jambor  mjam...@suse.cz
Wei Mi  w...@google.com

PR ipa/60449
PR middle-end/61776
* testsuite/gcc.dg/lto/pr60449_1.c: New test.
* testsuite/gcc.dg/lto/pr60449_0.c: New test.
* testsuite/gcc.dg/pr61776.c: New test.


Added:
branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/lto/pr60449_0.c
branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/lto/pr60449_1.c
branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr61776.c
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/gimple.h
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
branches/gcc-4_9-branch/gcc/tree-cfg.c
branches/gcc-4_9-branch/gcc/tree-cfgcleanup.c
branches/gcc-4_9-branch/gcc/tree-ssa-operands.c
branches/gcc-4_9-branch/gcc/tree-ssanames.h


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-07-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.9.1   |4.9.2

--- Comment #15 from Jakub Jelinek jakub at gcc dot gnu.org ---
GCC 4.9.1 has been released.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-06-24 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Martin Jambor jamborm at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu.org

--- Comment #14 from Martin Jambor jamborm at gcc dot gnu.org ---
Created attachment 32997
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=32997action=edit
RFC patch

After playing around with aliases (of extern symbols) for a while I
decided that any such fix to this problem would be too invasive and
generally terrible.  Therefore, I set out to prepare a patch that
would put the leaf flag into individual gimple call statements and
that would also do what Richi suggested in comment #10, ie. remove
MODIFIED_NORETURN_CALLS by having a noreturn flag in calls too.

I may not get back to this for a while so I'm posting what I've got,
inviting comments on the general direction of the patch, even though
it is not at the submission level yet.  It bootstraps but it
introduces one (yet totally unexamined) asan test failure.  I'm also
worried about the occasional discrepancy between the decl and the call
noreturn flags, it would be nice to make it somehow clearer when to
use what.

I've also started to think that setting both the two new flags lazily
in the cfg cleanup was probably a mistake.  Verifier requires special
treatment when noreturn IS set and when leaf IS NOT set, which means
that the cfg cleanup sometimes must be run even though the cfg has not
actually changed (but a call was re-built) which is weird.
So in the next iteration I'll probably try to set the leaf flag when
building the statement and maintain it from that point on.

But that may not happen until late July.  Meanwhile, almost anyone
bumping into this problem can use the first provisional fix.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-06-12 Thread mliska at suse dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Martin Liška mliska at suse dot cz changed:

   What|Removed |Added

 CC||mliska at suse dot cz

--- Comment #13 from Martin Liška mliska at suse dot cz ---
Same problem can be seen in Chromium. The final binary contains about ~3500
usages of a function with different DECL attributes. Problematic is just one
function:

sigaction/538949 (sigaction) @0x7f0fb8916450
 DECL_ATTR:
sigaction/718813 (sigaction) @0x7f0fb7db58a0
 DECL_ATTR: __leaf__ , __nothrow__ 

Thus, preserving both variants of the function would not increase symtab
significantly.

[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-04-22 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.9.0   |4.9.1

--- Comment #12 from Jakub Jelinek jakub at gcc dot gnu.org ---
GCC 4.9.0 has been released


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-04-02 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #11 from Jan Hubicka hubicka at gcc dot gnu.org ---
 OTOH, why do we have to merge the decls/cgraph nodes at all?  Can't we simply
 make them aliases if tree merging decides the decls are not equal?

If we do so, we would never merge external declaration from one unit with
definition from other, so everything would go through aliases effectively
doubling the symtab. 

Also aliases currently ar different symbols, not different tree representation
of the same symbol, so one would need to rename the declaration and make it to
bubble all the way into the assembler file.

We can resort to not merging in selected cases, but I would prefer to do that
only when we have very good reason why we want to do so.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-04-01 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #8 from Richard Biener rguenth at gcc dot gnu.org ---
*** Bug 60721 has been marked as a duplicate of this bug. ***


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-04-01 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #9 from Richard Biener rguenth at gcc dot gnu.org ---
(In reply to Richard Biener from comment #8)
 *** Bug 60721 has been marked as a duplicate of this bug. ***

See there for another proposed fix to retain per-call 'leaf' (well,
no-abnormal-goto) status.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-04-01 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #10 from Richard Biener rguenth at gcc dot gnu.org ---
(In reply to Richard Biener from comment #9)
 (In reply to Richard Biener from comment #8)
  *** Bug 60721 has been marked as a duplicate of this bug. ***
 
 See there for another proposed fix to retain per-call 'leaf' (well,
 no-abnormal-goto) status.

Btw, similar to this flag a flag for a per-call 'noreturn' status should
be added as well, getting rid of that MODIFIED_NORETURN_CALLS red herring
on the way (basically defer committing 'noreturn' from a decl to all callers
until a suitable time).  I suppose different 'noreturn' status in LTO units
can also cause a similar issue where a (no longer after merging) noreturn
call ending BB fails to have a fallthru edge.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-03-07 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #5 from Richard Biener rguenth at gcc dot gnu.org ---
Shouldn't fixup_cfg fix this up?  Simply prefering the decl with attributes
isn't enough if you attach an urelated attribute to both fns as well.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-03-07 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #6 from Richard Biener rguenth at gcc dot gnu.org ---
OTOH, why do we have to merge the decls/cgraph nodes at all?  Can't we simply
make them aliases if tree merging decides the decls are not equal?


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-03-07 Thread jamborm at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Martin Jambor jamborm at gcc dot gnu.org changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #7 from Martin Jambor jamborm at gcc dot gnu.org ---
(In reply to Richard Biener from comment #5)
 Shouldn't fixup_cfg fix this up?  Simply prefering the decl with attributes
 isn't enough if you attach an urelated attribute to both fns as well.

Yes, I know.  I did not really mean to call it a proposed fix, did
that somewhat automatically.  On the other hand, I am able to slim-LTO
build Firefox with the patch though.

(In reply to Richard Biener from comment #6)
 OTOH, why do we have to merge the decls/cgraph nodes at all?  Can't we simply
 make them aliases if tree merging decides the decls are not equal?

Good idea, this might indeed be the best way to fix this.  (Although I
do not really know what needs to be done to turn a previously proper
decl and its symtab node into an alias.  Honza, do you think it would
be difficult?).


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-03-06 Thread jamborm at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #1 from Martin Jambor jamborm at gcc dot gnu.org ---
Created attachment 32289
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32289action=edit
Part one of a testcase


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-03-06 Thread jamborm at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #2 from Martin Jambor jamborm at gcc dot gnu.org ---
Created attachment 32290
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32290action=edit
Part two of a testcase


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-03-06 Thread trippels at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-03-06
 CC||trippels at gcc dot gnu.org
   Target Milestone|--- |4.9.0
 Ever confirmed|0   |1

--- Comment #3 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
Confirmed.


[Bug lto/60449] Merging function DECLs discards leaf attribute which causes cfg verifier to fail

2014-03-06 Thread jamborm at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60449

--- Comment #4 from Martin Jambor jamborm at gcc dot gnu.org ---
Created attachment 32291
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32291action=edit
Untested proposed fix

Untested proposed fix