public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/34773]  New: fwprop1 bug causing miscompilation of vfprintf_r
@ 2008-01-13 18:51 hp at gcc dot gnu dot org
  2008-01-13 18:51 ` [Bug rtl-optimization/34773] " hp at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-01-13 18:51 UTC (permalink / raw)
  To: gcc-bugs

See attachment vf.i.
The bug manifests in code roughly corresponding to the code snippet:
union double_union
{
  double d;
  __uint32_t i[2];
};
union double_union tmp; tmp.d = value;
 if ((tmp.i[1]) & ((__uint32_t)0x80000000L)) {
  value = -value;
  *sign = '-';
 } else
  *sign = '\000';

As manifested by the 142.fwprop1 dump compared to 141.cse1 dump, fwprop1 has
changed
(note 628 627 630 101 [bb 101] NOTE_INSN_BASIC_BLOCK)
(insn 630 628 632 101 vf.i:1270 (set (reg:SI 277)
        (const_int -2147483648 [0xffffffff80000000])) 38 {*movsi_internal}
(nil))
(insn 632 630 629 101 vf.i:1270 (clobber (reg/v:DF 77 [ __x.739 ])) -1
(insn_list:REG_LIBCALL 631 (nil)))
(insn 629 632 631 101 vf.i:1270 (set (subreg:SI (reg/v:DF 77 [ __x.739 ]) 0)
        (subreg:SI (reg/v:DF 152 [ __x ]) 0)) 38 {*movsi_internal}
(expr_list:REG_NO_CONFLICT (reg/v:DF 152 [ __x ])
        (nil)))
(insn 631 629 633 101 vf.i:1270 (set (subreg:SI (reg/v:DF 77 [ __x.739 ]) 4)
        (xor:SI (subreg:SI (reg/v:DF 152 [ __x ]) 4)
            (reg:SI 277))) 155 {xorsi3} (insn_list:REG_RETVAL 632
(expr_list:REG_NO_CONFLICT (reg/v:DF 152 [ __x ])
            (nil))))

into:
(note 628 627 631 103 [bb 103] NOTE_INSN_BASIC_BLOCK)
(insn 631 628 633 103 vf.i:1270 (set (subreg:SI (reg/v:DF 77 [ __x.739 ]) 4)
        (plus:SI (subreg:SI (reg/v:DF 152 [ __x ]) 4)
            (const_int -2147483648 [0xffffffff80000000]))) 75 {*addsi3_non_v32}
(expr_list:REG_NO_CONFLICT (reg/v:DF 152 [ __x ])
        (nil)))
(insn 633 631 634 103 vf.i:1270 (set (reg/v:QI 161 [ softsign ])
        (const_int 45 [0x2d])) 47 {movqi} (nil))
(code_label 634 633 635 104 86 "" [0 uses])

thereby making the lower part of the mantissa in (reg:DF 77) undefined and the
bug manifestation depending on stack contents.
Trunk of 130734 was used for the dump above.


-- 
           Summary: fwprop1 bug causing miscompilation of vfprintf_r
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: hp at gcc dot gnu dot org
        ReportedBy: hp at gcc dot gnu dot org
GCC target triplet: cris-elf


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-02-01 21:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-13 18:51 [Bug rtl-optimization/34773] New: fwprop1 bug causing miscompilation of vfprintf_r hp at gcc dot gnu dot org
2008-01-13 18:51 ` [Bug rtl-optimization/34773] " hp at gcc dot gnu dot org
2008-01-13 19:20 ` hp at gcc dot gnu dot org
2008-01-13 19:21 ` hp at gcc dot gnu dot org
2008-01-13 21:07 ` rguenth at gcc dot gnu dot org
2008-01-14  9:34 ` hp at gcc dot gnu dot org
2008-01-26 22:59 ` [Bug rtl-optimization/34773] [4.3 regression] " hp at gcc dot gnu dot org
2008-01-29  6:31 ` hp at gcc dot gnu dot org
2008-01-31  6:38 ` hp at gcc dot gnu dot org
2008-01-31 10:56 ` [Bug rtl-optimization/34773] [4.3 Regression] " rguenth at gcc dot gnu dot org
2008-02-01 21:29 ` hp at gcc dot gnu dot org
2008-02-01 21:30 ` hp at gcc dot gnu dot org
2008-02-01 21:31 ` hp at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).