[patch] Fix GC issue triggered by arithmetic overflow checking

Jakub Jelinek jakub@redhat.com
Thu Oct 13 10:37:00 GMT 2016


On Thu, Oct 13, 2016 at 12:19:53PM +0200, Richard Biener wrote:
> > (note 6350 6349 6351 (var_location temp (nil)) NOTE_INSN_VAR_LOCATION)
> > (note 6351 6350 6352 (var_location temp$low (mem/c:DI (plus:SI (reg/f:SI 30
> > %fp)
> >         (const_int -112 [0xffffffffffffff90])) [10 MEM[(struct cpp_num
> > *)&result + 8B]+0 S8 A64])) NOTE_INSN_VAR_LOCATION)
> > (note 6352 6351 6353 (var_location temp$8 (nil)) NOTE_INSN_VAR_LOCATION)
> > [...]
> > (code_label 2091 6355 2092 79 912 "" [1 uses])
> > (note 2092 2091 5271 79 [bb 79] NOTE_INSN_BASIC_BLOCK)
> >
> > is interpreted differently from:
> >
> > (note 6350 6349 6351 (var_location temp (nil)) NOTE_INSN_VAR_LOCATION)
> > (note 6351 6350 6352 (var_location temp$8 (nil)) NOTE_INSN_VAR_LOCATION)
> > (note 6352 6351 6353 (var_location temp$low (mem/c:DI (plus:SI (reg/f:SI 30
> > %fp)
> >         (const_int -112 [0xffffffffffffff90])) [10 MEM[(struct cpp_num
> > *)&result + 8B]+0 S8 A64])) NOTE_INSN_VAR_LOCATION)
> > [...]
> > (note 2092 2091 5271 79 [bb 79] NOTE_INSN_BASIC_BLOCK)
> >
> > @@ -32608,6 +32608,17 @@
> >         .uleb128 0x8
> >         .byte   0x93    ! DW_OP_piece
> >         .uleb128 0x8
> > +       .uaword .LLVL592-.LLtext0       ! Location list begin address
> > (*.LLLST153)
> > +       .uaword .LLVL597-.LLtext0       ! Location list end address
> > (*.LLLST153)
> > +       .uahalf 0x9     ! Location expression size
> > +       .byte   0x93    ! DW_OP_piece
> > +       .uleb128 0x8
> > +       .byte   0x8e    ! DW_OP_breg30
> > +       .sleb128 -112
> > +       .byte   0x93    ! DW_OP_piece
> > +       .uleb128 0x8
> > +       .byte   0x93    ! DW_OP_piece
> > +       .uleb128 0x8
> >         .uaword .LLVL695-.LLtext0       ! Location list begin address
> > (*.LLLST153)
> >         .uaword .LLVL696-.LLtext0       ! Location list end address
> > (*.LLLST153)
> >         .uahalf 0xe     ! Location expression size
> >
> > probably because the non-null location comes last in the second case.
> 
> Definitely looks like a bug to me.  Can you open a PR for this so it doesn't get
> lost?

I guess it depends on whether temp$8 and temp$low overlap or not.  If they
overlap, then the different orders of course matter and should matter.

	Jakub



More information about the Gcc-patches mailing list