public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: middle-end/3919: __builtin_constant_p false on long long compile-time-known variable converted to long on 32-bit platform
@ 2002-11-29 16:26 bangerth
0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-11-29 16:26 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, lkb, nobody
Synopsis: __builtin_constant_p false on long long compile-time-known variable converted to long on 32-bit platform
State-Changed-From-To: feedback->closed
State-Changed-By: bangerth
State-Changed-When: Wed Nov 20 18:50:46 2002
State-Changed-Why:
No feedback in a long time and user error anyway.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3919
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: middle-end/3919: __builtin_constant_p false on long long compile-time-known variable converted to long on 32-bit platform
@ 2002-04-04 4:24 rth
0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2002-04-04 4:24 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, lkb, nobody
Synopsis: __builtin_constant_p false on long long compile-time-known variable converted to long on 32-bit platform
State-Changed-From-To: open->feedback
State-Changed-By: rth
State-Changed-When: Thu Apr 4 04:23:59 2002
State-Changed-Why:
Err.. why do you believe this should return 3 and not 0?
What is it about "var" that can be considered constant?
Seems to me if you got anything besides 0 you should have
been submitting _that_ as a bug...
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3919
^ permalink raw reply [flat|nested] 3+ messages in thread
* middle-end/3919: __builtin_constant_p false on long long compile-time-known variable converted to long on 32-bit platform
@ 2001-08-02 19:46 lkb
0 siblings, 0 replies; 3+ messages in thread
From: lkb @ 2001-08-02 19:46 UTC (permalink / raw)
To: gcc-gnats
>Number: 3919
>Category: middle-end
>Synopsis: __builtin_constant_p false on long long compile-time-known variable converted to long on 32-bit platform
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Thu Aug 02 19:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Luca Barbieri
>Release: 3.0
>Organization:
>Environment:
i686-pc-cygwin CYGWIN_NT-5.0 1.3.2(0.39/3/2) i686 unknown
>Description:
__builtin_constant_p returns false when it's called on a global long long variable, known to be constant (__builtin_constant_p returns true on it without typecasts), typecasted to long (probably happens for all 32-bit platforms, but only tested on i386).
This bug isn't present for local variables.
This bug is present at any optimization level.
>How-To-Repeat:
// Compile this (as either C or C++) and check the return value from the shell
// Returns: 2
// Should return: 3
long long var;
int main(int argc, char** argv)
{
var = 0;
return (__builtin_constant_p(var) ? 2 : 0)
| (__builtin_constant_p((long)var) ? 1 : 0);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-11-21 2:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-29 16:26 middle-end/3919: __builtin_constant_p false on long long compile-time-known variable converted to long on 32-bit platform bangerth
-- strict thread matches above, loose matches on Subject: below --
2002-04-04 4:24 rth
2001-08-02 19:46 lkb
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).