This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/49847] [4.7 Regression] NULL deref in fold_rtx (prev_insn_cc0 == NULL)


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

--- Comment #16 from Mikael Pettersson <mikpe at it dot uu.se> 2012-02-26 18:25:36 UTC ---
Created attachment 26757
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26757
make fold_rtx handle prev_insn_cc0 == NULL

The effect of Richard Guenther's r180192 patch to tree-eh.c is that "g >= 0.0"
(or its gimple equivalent) is recognized as potentially trapping, which causes
the cc0 setter and user to be put in separate BBs.  That's usually a no-no, but
in the case of EH I'm not sure it can be avoided.  Then as fold_rtx processes
the cc0 user at the start of the second BB, prev_insn_cc0 is NULL causing
equiv_constant to crash.

With the attached patch fold_rtx simply doesn't try to fold the current rtx
when prev_insn_cc0 is NULL.  A build of 4.7-20120225 as a cross to m68k-linux
with java enabled succeeded with this patch applied, and it handled Andreas'
c++ test case too.  I'm currently attempting a native bootstrap with both java
and ada enabled.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]