This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimization/10252: __builtin_constant_p() returns TRUE for non-constant expression


>Number:         10252
>Category:       optimization
>Synopsis:       __builtin_constant_p() returns TRUE for non-constant expression
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 28 07:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     David Mosberger
>Release:        gcc version 3.4 20030327 (experimental)
>Organization:
>Environment:
IA-64 Linux
>Description:
The attached test-program demonstrates a case where GCC
thinks a non-constant expression is constant.  When compiled
with -O2, the resulting object file will have an undefined
reference to __bad_stuff().  The problem doesn't show with
lower optimization levels.

>How-To-Repeat:
gcc -Wall -c -O2 sem.i
nm sem.o |grep bad
                 U __bad_stuff
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="sem.i"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="sem.i"

c3RydWN0IHNlbWEgewoJaW50IHNsZWVwZXJzOwp9OwoKdm9pZApmb28gKHN0cnVjdCBzZW1hICog
c2VtKQp7CglleHRlcm4gdm9pZCBfX2JhZF9zdHVmZiAodm9pZCk7CgogICAgICAgIGZvciAoOzsp
IHsKICAgICAgICAgICAgICAgIGlmIChzZW0pIHsKCQkJaWYgKF9fYnVpbHRpbl9jb25zdGFudF9w
KHNlbS0+c2xlZXBlcnMpKQoJCQkJX19iYWRfc3R1ZmYoKTsKICAgICAgICAgICAgICAgICAgICAg
ICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgfQp9Cg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]