[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-25 Thread jakub at gcc dot gnu.org


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



Jakub Jelinek  changed:



   What|Removed |Added



 Status|WAITING |RESOLVED

 Resolution||FIXED



--- Comment #14 from Jakub Jelinek  2013-02-25 
11:58:41 UTC ---

Fixed.  If there is an issue on picochip, new PR should be created for that.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-25 Thread vries at gcc dot gnu.org


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



--- Comment #13 from vries at gcc dot gnu.org 2013-02-25 11:53:55 UTC ---

PR56131 has been re-fixed, so this PR should not trigger anymore on hppa.

However, it might still trigger on picochip (see also

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56131#c18).


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-21 Thread steven at gcc dot gnu.org


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



Steven Bosscher  changed:



   What|Removed |Added



 Depends on||56131



--- Comment #12 from Steven Bosscher  2013-02-21 
10:33:11 UTC ---

(In reply to comment #2)

> I'd say if NOTE_INSN_BASIC_BLOCK has NULL BLOCK_FOR_INSN, rather than 

> trying to use NOTE_BASIC_BLOCK the code should just assume cfg has been 

> freed and can't be used.



Right. I just added the same comment to bug 56131 and re-opened it.  This

bug 56242 is just collateral from the incorrect fix for bug 56131.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-21 Thread steven at gcc dot gnu.org


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



Steven Bosscher  changed:



   What|Removed |Added



 CC||steven at gcc dot gnu.org



--- Comment #11 from Steven Bosscher  2013-02-21 
10:31:03 UTC ---

(In reply to comment #3)



> Index: cfgrtl.c

> ===

> --- cfgrtl.c (revision 195874)

> +++ cfgrtl.c (working copy)

> @@ -119,6 +119,28 @@ can_delete_label_p (const_rtx label)

>&& !in_expr_list_p (forced_labels, label));

>  }

> 

> +static void

> +update_next_prev_in_sequence (const_rtx insn)



This wouldn't belong in cfgrtl.c but in emit-rtl.c.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-20 Thread law at redhat dot com


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



--- Comment #10 from Jeffrey A. Law  2013-02-20 19:47:53 
UTC ---

My first thought WRT the actual patch itself is why not put the logic to fixup

the insn chain for SEQUENCEs at the end of reorder_insns_nobb?  That would

avoid similar problems for any other code that used this function after reorg.c

had started.



It also seems to me there are 4 cases that need to be fixed.



FROM is a SEQUENCE

  Need to fix PREV_INSN of the first insn in the SEQUENCE



TO is a SEQUENCE

  Need to fix NEXT_INSN of the last insn in the SEQUENCE



PREV_INSN (FROM) is a sequence

  Need to fix NEXT_INSN of the last INSN in the SEQUENCE



NEXT_INSN (TO) is a sequence

  Need to fix PREV_INSN of the first INSN in the SEQUENCE



Am I missing something here?


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-20 Thread law at redhat dot com


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



--- Comment #9 from Jeffrey A. Law  2013-02-20 19:06:53 
UTC ---

Given this built & reg-tested on mips (which uses reorg) and is reported to fix

the ICE on the PA, I don't think we need to wait on the PA testing results.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-20 Thread rguenth at gcc dot gnu.org


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



Richard Biener  changed:



   What|Removed |Added



   Priority|P3  |P1

 Status|UNCONFIRMED |WAITING

   Last reconfirmed||2013-02-20

 Ever Confirmed|0   |1



--- Comment #8 from Richard Biener  2013-02-20 
14:27:57 UTC ---

Any updates?


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-14 Thread dave.anglin at bell dot net


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



--- Comment #7 from dave.anglin at bell dot net 2013-02-14 13:56:13 UTC ---

Patch fixes ICE on hppa2.0w-hp-hpux11.11.  Testsuite running...


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-14 Thread vries at gcc dot gnu.org


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



--- Comment #6 from vries at gcc dot gnu.org 2013-02-14 09:11:06 UTC ---

> New version of the patch, the previous one did PATTERN (PATTERN ()). I'm

> bootstrapping this now on x86_64, and will test it on mips.



Bootstrapped and reg-tested on x86_64. Build and reg-tested on mips. No issues

found.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-13 Thread vries at gcc dot gnu.org


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



--- Comment #5 from vries at gcc dot gnu.org 2013-02-13 15:44:21 UTC ---

Created attachment 29440

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29440

delete-insn-tentative-fix-PR56242.patch



> I'll give your patch a try later today when my current build and check 

> finishes.



New version of the patch, the previous one did PATTERN (PATTERN ()). I'm

bootstrapping this now on x86_64, and will test it on mips.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-13 Thread dave.anglin at bell dot net


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



--- Comment #4 from dave.anglin at bell dot net 2013-02-13 14:09:26 UTC ---

On 2013-02-12 6:03 PM, vries at gcc dot gnu.org wrote:

> I've tried to reproduce this bug by building a cross compiler using the

> hppa2.0w-unknown-linux-gnu target. I managed to build libjava, but I didn't

> manage to reproduce the bug.

Yes. it doesn't reproduce on linux.



>

> The thing I can see that's wrong is in NEXT_INSN (insn 11), which is note 152

> but which should be note 153:

> ...

> (insn 428 427 153 (sequence [

>  (jump_insn:TI 151 427 11 (set (pc)

>  (if_then_else (eq (reg:SI 28 %r28 [orig:123 D.12040+-2 ]

> [123])

>  (const_int 10 [0xa]))

>  (label_ref:SI 165)

>  (pc)))

> /test/gnu/gcc/gcc/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:162

> 28 {*pa.md:1439}

>   (expr_list:REG_DEAD (reg:SI 28 %r28 [orig:123 D.12040+-2 ]

> [123])

>  (expr_list:REG_BR_PROB (const_int 2800 [0xaf0])

>  (nil)))

>   -> 165)

>  (insn 11 151 152 (set (reg:SI 7 %r7 [orig:129 D.12038 ] [129])

>  (reg:SI 5 %r5 [orig:132 ivtmp.903 ] [132])) 40

> {*pa.md:2211}

>   (nil))

>  ])

> /test/gnu/gcc/gcc/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:162

> -1

>   (nil))

>

> (note 153 428 152 [bb 19] NOTE_INSN_BASIC_BLOCK)

>

> (note 152 153 276 19 ("*L$Jpc=71164") NOTE_INSN_DELETED_LABEL 395)

> ...



I'll give your patch a try later today when my current build and check 

finishes.  I could give you

access to this test system if the change doesn't work out.



Thanks for looking at this bug.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-12 Thread vries at gcc dot gnu.org


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



vries at gcc dot gnu.org changed:



   What|Removed |Added



   Priority|P1  |P3



--- Comment #3 from vries at gcc dot gnu.org 2013-02-13 00:03:45 UTC ---

I don't have an hp machine to reproduce this (I've asked for access to the gcc

compile farm 2 weeks ago).



I've tried to reproduce this bug by building a cross compiler using the

hppa2.0w-unknown-linux-gnu target. I managed to build libjava, but I didn't

manage to reproduce the bug.



The thing I can see that's wrong is in NEXT_INSN (insn 11), which is note 152

but which should be note 153:

...

(insn 428 427 153 (sequence [

(jump_insn:TI 151 427 11 (set (pc)

(if_then_else (eq (reg:SI 28 %r28 [orig:123 D.12040+-2 ]

[123])

(const_int 10 [0xa]))

(label_ref:SI 165)

(pc)))

/test/gnu/gcc/gcc/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:162

28 {*pa.md:1439}

 (expr_list:REG_DEAD (reg:SI 28 %r28 [orig:123 D.12040+-2 ]

[123])

(expr_list:REG_BR_PROB (const_int 2800 [0xaf0])

(nil)))

 -> 165)

(insn 11 151 152 (set (reg:SI 7 %r7 [orig:129 D.12038 ] [129])

(reg:SI 5 %r5 [orig:132 ivtmp.903 ] [132])) 40

{*pa.md:2211}

 (nil))

])

/test/gnu/gcc/gcc/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:162

-1

 (nil))



(note 153 428 152 [bb 19] NOTE_INSN_BASIC_BLOCK)



(note 152 153 276 19 ("*L$Jpc=71164") NOTE_INSN_DELETED_LABEL 395)

...



The code that deletes undeletable labels uses reorder_insns_nobb which is

deprecated and doesn't know about SEQUENCEs:

...

/* This function is deprecated, please use sequences instead.



   Move a consecutive bunch of insns to a different place in the chain.

   The insns to be moved are those between FROM and TO.

   They are moved to a new position after the insn AFTER.

   AFTER must not be FROM or TO or any insn in between.



   This function does not know about SEQUENCEs and hence should not be

   called after delay-slot filling has been done.  */



void

reorder_insns_nobb (rtx from, rtx to, rtx after)

...



A fixup patch like this might work:

...

Index: cfgrtl.c

===

--- cfgrtl.c (revision 195874)

+++ cfgrtl.c (working copy)

@@ -119,6 +119,28 @@ can_delete_label_p (const_rtx label)

   && !in_expr_list_p (forced_labels, label));

 }



+static void

+update_next_prev_in_sequence (const_rtx insn)

+{

+  rtx seq;

+  unsigned int length;

+

+  if (insn == NULL_RTX

+  || !INSN_P (insn))

+return;

+

+  seq = PATTERN (insn);

+  if (GET_CODE (PATTERN (seq)) != SEQUENCE)

+return;

+

+  length = XVECLEN (seq, 0);

+  if (length == 0)

+return;

+

+  PREV_INSN (XVECEXP (seq, 0, 0)) = PREV_INSN (insn);

+  NEXT_INSN (XVECEXP (seq, 0, length - 1)) = NEXT_INSN (insn);

+}

+

 /* Delete INSN by patching it out.  */



 void

@@ -152,6 +174,8 @@ delete_insn (rtx insn)

   || label_bb == NULL))

 {

   reorder_insns_nobb (insn, insn, bb_note);

+  update_next_prev_in_sequence (PREV_INSN (bb_note));

+  update_next_prev_in_sequence (NEXT_INSN (insn));

   bb = NOTE_BASIC_BLOCK (bb_note);

   BB_HEAD (bb) = bb_note;

   if (BB_END (bb) == bb_note)

...


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-11 Thread jakub at gcc dot gnu.org


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



Jakub Jelinek  changed:



   What|Removed |Added



 CC||jakub at gcc dot gnu.org



--- Comment #2 from Jakub Jelinek  2013-02-11 
09:10:12 UTC ---

I'd say if NOTE_INSN_BASIC_BLOCK has NULL BLOCK_FOR_INSN, rather than trying to

use NOTE_BASIC_BLOCK the code should just assume cfg has been freed and can't

be used.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-08 Thread rguenth at gcc dot gnu.org


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



Richard Biener  changed:



   What|Removed |Added



   Priority|P3  |P1


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-08 Thread ebotcazou at gcc dot gnu.org


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



Eric Botcazou  changed:



   What|Removed |Added



 CC||ebotcazou at gcc dot

   ||gnu.org



--- Comment #1 from Eric Botcazou  2013-02-08 
11:37:28 UTC ---

> Was testing a new patch but I suspect this may have been caused by

> 

> 2013-02-06  Tom de Vries  

> 

> PR rtl-optimization/56131

> * cfgrtl.c (delete_insn): Use NOTE_BASIC_BLOCK instead of

> BLOCK_FOR_INSN

> to get the bb of a NOTE_INSN_BASIC_BLOCK.  Handle the case that the bb

> of the label is NULL.  Add comment.



I guess that the NOTE_BASIC_BLOCK notes are also invalid during reorg.


[Bug middle-end/56242] [4.8 Regression] libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:175:0: ICE: Segmentation fault

2013-02-08 Thread rguenth at gcc dot gnu.org


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



Richard Biener  changed:



   What|Removed |Added



 CC||vries at gcc dot gnu.org

   Target Milestone|--- |4.8.0