This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/47812] [x32] __builtin_strlen is miscompiled at -O2
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 19 Feb 2011 14:23:05 +0000
- Subject: [Bug target/47812] [x32] __builtin_strlen is miscompiled at -O2
- Auto-submitted: auto-generated
- References: <bug-47812-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47812
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2011-02-19 14:22:45 UTC ---
(In reply to comment #2)
> In ix86_expand_strlen:
>
> if (GET_MODE (out) != Pmode)
> out = convert_to_mode (Pmode, out, 1);
>
>
> Here out is REG:SI 59 -- the result register for strlen. After conversion, new
> reg:DI 64 is created. There are two problems here:
>
> 1) the result is now 64, but the caller 'expand_builtin_strlen' still uses reg
> 59
> 2) the conversion itself generates an uninitialized use.
>
Thanks for the analysis. This is a dup of PR47364. I have a patch.
*** This bug has been marked as a duplicate of bug 47364 ***