diff mbox

Correct fix for scheduler bug PR11320

Message ID 4E297FF8.9090504@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt July 22, 2011, 1:49 p.m. UTC
On 07/19/11 14:25, Andreas Schwab wrote:
> I'm now seeing this ICE:
> 
> /bin/sh ./libtool --tag=GCJ   --mode=compile /usr/local/gcc/gcc-20110719/Build/./gcc/gcj -B/usr/local/gcc/gcc-20110719/Build/ia64-suse-linux/libjava/ -B/usr/local/gcc/gcc-20110719/Build/./gcc/ -B/usr/ia64-suse-linux/bin/ -B/usr/ia64-suse-linux/lib/ -isystem /usr/ia64-suse-linux/include -isystem /usr/ia64-suse-linux/sys-include    -funwind-tables -fclasspath= -fbootclasspath=../../../libjava/classpath/lib --encoding=UTF-8 -Wno-deprecated -fbootstrap-classes -g -O2  -c -o java/lang/ref.lo -fsource-filename=/usr/local/gcc/gcc-20110719/Build/ia64-suse-linux/libjava/classpath/lib/classes -MT java/lang/ref.lo -MD -MP -MF java/lang/ref.deps @java/lang/ref.list
> libtool: compile:  /usr/local/gcc/gcc-20110719/Build/./gcc/gcj -B/usr/local/gcc/gcc-20110719/Build/ia64-suse-linux/libjava/ -B/usr/local/gcc/gcc-20110719/Build/./gcc/ -B/usr/ia64-suse-linux/bin/ -B/usr/ia64-suse-linux/lib/ -isystem /usr/ia64-suse-linux/include -isystem /usr/ia64-suse-linux/sys-include -funwind-tables -fclasspath= -fbootclasspath=../../../libjava/classpath/lib --encoding=UTF-8 -Wno-deprecated -fbootstrap-classes -g -O2 -c -fsource-filename=/usr/local/gcc/gcc-20110719/Build/ia64-suse-linux/libjava/classpath/lib/classes -MT java/lang/ref.lo -MD -MP -MF java/lang/ref.deps @java/lang/ref.list  -fPIC -o java/lang/.libs/ref.o
> /usr/local/gcc/gcc-20110719/libjava/classpath/java/lang/ref/ReferenceQueue.java: In class 'java.lang.ref.ReferenceQueue':
> /usr/local/gcc/gcc-20110719/libjava/classpath/java/lang/ref/ReferenceQueue.java: In method 'java.lang.ref.ReferenceQueue.enqueue(java.lang.ref.Reference)':
> In file included from /usr/local/gcc/gcc-20110719/libjava/java/lang/ref/Reference.java:202:0,
>                  from /usr/local/gcc/gcc-20110719/libjava/classpath/java/lang/ref/PhantomReference.java:75,
>                  from <built-in>:6:
> /usr/local/gcc/gcc-20110719/libjava/classpath/java/lang/ref/ReferenceQueue.java:97:0: internal compiler error: in advance_target_bb, at sched-ebb.c:691
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> make[3]: *** [java/lang/ref.lo] Error 1

It's getting confused about loads/stores being control_flow_insns and
getting scheduled past each other nonetheless. Mind testing the following?


Bernd

Comments

Eric Botcazou July 22, 2011, 5 p.m. UTC | #1
> It's getting confused about loads/stores being control_flow_insns and
> getting scheduled past each other nonetheless. Mind testing the following?

s/flag_non_call_exceptions/cfun->can_throw_non_call_exceptions/
Richard Henderson July 22, 2011, 5:17 p.m. UTC | #2
On 07/22/2011 10:00 AM, Eric Botcazou wrote:
>> It's getting confused about loads/stores being control_flow_insns and
>> getting scheduled past each other nonetheless. Mind testing the following?
> 
> s/flag_non_call_exceptions/cfun->can_throw_non_call_exceptions/
> 

Why test either, since control_flow_insn_p has already done so?


r~
Bernd Schmidt July 22, 2011, 5:23 p.m. UTC | #3
On 07/22/11 19:17, Richard Henderson wrote:
> On 07/22/2011 10:00 AM, Eric Botcazou wrote:
>>> It's getting confused about loads/stores being control_flow_insns and
>>> getting scheduled past each other nonetheless. Mind testing the following?
>>
>> s/flag_non_call_exceptions/cfun->can_throw_non_call_exceptions/
>>
> 
> Why test either, since control_flow_insn_p has already done so?

Just to save an unnecessary call to add_dependence.

Although, come to think of it, it might not be unnecessary. The reason
these two insns aren't already dependent on each other seems to be that
they have opposite conditions, and I guess that might happen with
conditional calls as well.


Bernd
diff mbox

Patch

Index: gcc/sched-ebb.c
===================================================================
--- gcc/sched-ebb.c	(revision 176579)
+++ gcc/sched-ebb.c	(working copy)
@@ -397,6 +397,9 @@  add_deps_for_risky_insns (rtx head, rtx
 	  bb = BLOCK_FOR_INSN (insn);
 	  bb->aux = last_block;
 	  last_block = bb;
+	  if (flag_non_call_exceptions && last_jump != NULL_RTX)
+	    add_dependence (insn, last_jump, REG_DEP_ANTI);
+
 	  last_jump = insn;
 	}
       else if (INSN_P (insn) && last_jump != NULL_RTX)