[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-21 Thread rguenth at gcc dot gnu.org


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



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

 Resolution||FIXED



--- Comment #16 from Richard Biener rguenth at gcc dot gnu.org 2012-12-21 
12:18:50 UTC ---

This bug has been hijacked multiple times for related stuff it seems.  In

particular aermod works for me on x86_64 now.



Please re-open if the original bug (see $summary) still persists.  Please

open new bugreports for everything else.  Thanks.


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-05 Thread krebbel at gcc dot gnu.org


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



--- Comment #9 from Andreas Krebbel krebbel at gcc dot gnu.org 2012-12-05 
11:54:11 UTC ---

Created attachment 28879

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

Reduced testcase


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-05 Thread krebbel at gcc dot gnu.org


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



Andreas Krebbel krebbel at gcc dot gnu.org changed:



   What|Removed |Added



 CC||krebbel at gcc dot gnu.org



--- Comment #10 from Andreas Krebbel krebbel at gcc dot gnu.org 2012-12-05 
11:56:03 UTC ---

The attached testcase gets miscompiled starting with that revision.



cc1  -fpreprocessed -quiet  -O2 -march=z196 -funroll-loops  t.c 



Perl_lex_start:

.LFB0:

stgrl%r2,PL_linestr

tm13(%r2),128

stmg%r14,%r15,112(%r15)

.LCFI0:

lay%r15,-168(%r15)

.LCFI1:

jne.L6

l%r0,12-- broken (access to absolute address 12)

lgrl%r2,PL_linestr

.L2:

tmlh%r0,4

jne.L1

la%r3,160(%r15)

lghi%r4,2

brasl%r14,Perl_sv_2pv_flags

.L1:

lmg%r14,%r15,280(%r15)

.LCFI2:

br%r14

.L6:

.LCFI3:

brasl%r14,Perl_sv_2mortal

stgrl%r2,PL_linestr

l%r0,12(%r2)

j.L2


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-05 Thread krebbel at gcc dot gnu.org


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



--- Comment #11 from Andreas Krebbel krebbel at gcc dot gnu.org 2012-12-05 
11:58:25 UTC ---

Created attachment 28880

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

web output r192525


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-05 Thread krebbel at gcc dot gnu.org


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



--- Comment #12 from Andreas Krebbel krebbel at gcc dot gnu.org 2012-12-05 
11:58:53 UTC ---

Created attachment 28881

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

web output r192526


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-05 Thread steven at gcc dot gnu.org


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



--- Comment #13 from Steven Bosscher steven at gcc dot gnu.org 2012-12-05 
12:24:27 UTC ---

(In reply to comment #10)

 The attached testcase gets miscompiled starting with that revision.



And is not fixed after r194108?


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-05 Thread steven at gcc dot gnu.org


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



--- Comment #14 from Steven Bosscher steven at gcc dot gnu.org 2012-12-05 
12:32:24 UTC ---

Nothing new here, just yet another invalid REG_EQUAL note:



The webizer tries to split r51 in this insn:



;; basic block 4, loop depth 0, count 0, freq 7100, maybe hot

;;  prev block 3, next block 5, flags: (REACHABLE, RTL, MODIFIED)

;;  pred:   2 [71.0%]

;; bb 4 artificial_defs: { }

;; bb 4 artificial_uses: { u20(11){ }u21(15){ }u22(32){ }u23(34){ }}

;; lr  in11 [%r11] 15 [%r15] 32 [%ap] 34 [%fp] 55

;; lr  use   11 [%r11] 15 [%r15] 32 [%ap] 34 [%fp] 55

;; lr  def   48 50

;; live  in  11 [%r11] 15 [%r15] 32 [%ap] 34 [%fp] 55

;; live  gen 48 50

;; live  kill

(code_label 38 6 37 4 4  [1 uses])

(note 37 38 58 4 [bb 4] NOTE_INSN_BASIC_BLOCK)

(insn 58 37 5 4 (set (reg:SI 50 [ D.1400 ])

(reg:SI 55 [ D.1400 ])) 67 {*movsi_zarch}

 (expr_list:REG_EQUAL (mem:SI (plus:DI (reg/v/f:DI 51 [ line ])

(const_int 12 [0xc])) [4 line_4(D)-sv_flags+0 S4 A32])

(nil)))



Web oldreg=51 newreg=56

Updating insn 58 (51-56)



But r51 is not live on entry to bb4, and not defined in bb4 before insn58, so

it's a REG_EQUAL use of a dead register.



The sole DEF or r51 is a parameter load, and r55 is set almost immediately

after it:



(note 7 0 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(insn 2 7 3 2 (set (reg/v/f:DI 51 [ line ])

(reg:DI 2 %r2 [ line ])) t.c:25 63 {*movdi_64}

 (nil))

(note 3 2 9 2 NOTE_INSN_FUNCTION_BEG)

(insn 9 3 10 2 (set (mem/f/c:DI (symbol_ref:DI (PL_linestr) [flags 0x40] 

var_decl 0x3fff74f65f0 PL_linestr) [2 PL_linestr+0 S8 A64])

(reg/v/f:DI 51 [ line ])) t.c:28 63 {*movdi_64}

 (nil))

(insn 10 9 11 2 (set (reg:SI 55 [ D.1400 ])

(mem:SI (plus:DI (reg/v/f:DI 51 [ line ])

(const_int 12 [0xc])) [4 line_4(D)-sv_flags+0 S4 A32])) t.c:29

67 {*movsi_zarch}

 (nil))



r51 dies in in insn 10.


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-05 Thread krebbel at gcc dot gnu.org


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



--- Comment #15 from Andreas Krebbel krebbel at gcc dot gnu.org 2012-12-05 
12:55:41 UTC ---

(In reply to comment #13)

 (In reply to comment #10)

  The attached testcase gets miscompiled starting with that revision.

 

 And is not fixed after r194108?



Just tested with r194219 - works again. Thanks!


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-03 Thread rguenth at gcc dot gnu.org


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



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



   Priority|P3  |P1



--- Comment #7 from Richard Biener rguenth at gcc dot gnu.org 2012-12-03 
15:59:09 UTC ---

As far as I remember this is not yet fixed?


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-12-03 Thread steven at gcc dot gnu.org


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



Steven Bosscher steven at gcc dot gnu.org changed:



   What|Removed |Added



URL|http://gcc.gnu.org/ml/gcc-p |http://gcc.gnu.org/ml/gcc-p

   |atches/2012-11/msg01607.htm |atches/2012-12/msg00076.htm

   |l   |l



--- Comment #8 from Steven Bosscher steven at gcc dot gnu.org 2012-12-03 
16:03:19 UTC ---

Correct, not yet fixed. Patch is pending.

This is a bit of a can of worms, and getting a patch approved

has turned out to be a bit more troublesome than I had hoped.


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-11-27 Thread steven at gcc dot gnu.org


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



--- Comment #6 from Steven Bosscher steven at gcc dot gnu.org 2012-11-28 
00:17:40 UTC ---

Author: steven

Date: Wed Nov 28 00:17:34 2012

New Revision: 193876



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=193876

Log:

PR rtl-optimization/55006

* loop-unroll.c (struct iv_to_split): Add new 'orig_var' member.

(analyze_iv_to_split_insn): Record it.

(maybe_strip_eq_note_for_split_iv): New function to remove REG_EQUAL

notes that refer to IVs that are being split.

(apply_opt_in_copies): Use maybe_strip_eq_note_for_split_iv.  Twice.

Use FOR_BB_INSNS_SAFE.





Modified:

trunk/gcc/ChangeLog

trunk/gcc/loop-unroll.c


[Bug rtl-optimization/55006] [4.8 Regression] aermod.f90 is miscompiled with '-m64 -O2 -funroll-loops' after revision 192526

2012-11-19 Thread steven at gcc dot gnu.org


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



Steven Bosscher steven at gcc dot gnu.org changed:



   What|Removed |Added



 Target|x86_64-*-*  |

 Status|NEW |ASSIGNED

URL||http://gcc.gnu.org/ml/gcc-p

   ||atches/2012-11/msg01607.htm

   ||l

   Keywords||patch, wrong-code

   Last reconfirmed|2012-11-08 00:00:00 |2012-11-19 0:00

  Component|tree-optimization   |rtl-optimization

 CC|steven at gcc dot gnu.org   |

 AssignedTo|unassigned at gcc dot   |steven at gcc dot gnu.org

   |gnu.org |