public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: davidm@hpl.hp.com
To: gcc-gnats@gcc.gnu.org
Cc: rth@redhat.com
Subject: optimization/10252: __builtin_constant_p() returns TRUE for non-constant expression
Date: Fri, 28 Mar 2003 07:36:00 -0000	[thread overview]
Message-ID: <20030328073427.28398.qmail@sources.redhat.com> (raw)


>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==


             reply	other threads:[~2003-03-28  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-28  7:36 davidm [this message]
2003-03-28  8:46 Alan Modra
2003-03-31  1:16 rth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030328073427.28398.qmail@sources.redhat.com \
    --to=davidm@hpl.hp.com \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).