public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/49618] When building uClibc with GCC 4.6.1 old_atexit is miscompiled
Date: Mon, 04 Jul 2011 08:10:00 -0000	[thread overview]
Message-ID: <bug-49618-4-9BtSyHQS7j@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49618-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org, jakub at gcc dot
                   |                            |gnu.org, rsandifo at gcc
                   |                            |dot gnu.org

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-04 08:10:19 UTC ---
I think the problem is either that the MEM has the MEM_NOTRAP_P flag set on it:
(mem/f/i:SI (symbol_ref/i:SI ("__dso_handle") <var_decl 0x7ffff13ce320
__dso_handle>) [0 S4 A32])
That makes ifcvt believe it can try to use a conditional move with that as an
operand, and as there is no conditional move with MEM operand on this target,
it is forced into register first.

MEM_NOTRAP_P is set in set_mem_attributes_minus_bitpos:
  /* Note whether this expression can trap.  */
  MEM_NOTRAP_P (ref) = !tree_could_trap_p (t);
where t is VAR_DECL for __dso_handle with DECL_WEAK.

Or the problem might be that noce_try_cmove_arith should be using
  else if (may_trap_or_fault_p (a) || may_trap_or_fault_p (b))
    return FALSE;
instead of
  else if (may_trap_p (a) || may_trap_p (b))
    return FALSE;

Eric/Richard, what do you think?  The comments seem to be fuzzy to me, some
comments say that MEM_NOTRAP_P only apply to the position where the MEM is
originally used (and in this case the __dso_handle var is read only guarded
with if (__dso_handle != NULL), on the other side I wonder if we ever clear
MEM_NOTRAP_P on unguarded DECL_WEAK var references.


  parent reply	other threads:[~2011-07-04  8:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-03 10:53 [Bug tree-optimization/49618] New: " sedat.dilek at gmail dot com
2011-07-03 14:59 ` [Bug tree-optimization/49618] " tg at mirbsd dot org
2011-07-03 15:07 ` edwintorok at gmail dot com
2011-07-03 15:39 ` sedat.dilek at gmail dot com
2011-07-03 17:46 ` sedat.dilek at gmail dot com
2011-07-03 19:27 ` pinskia at gcc dot gnu.org
2011-07-03 19:28 ` pinskia at gcc dot gnu.org
2011-07-03 20:10 ` ernews at gmx dot de
2011-07-03 20:48 ` sedat.dilek at gmail dot com
2011-07-04  8:10 ` jakub at gcc dot gnu.org [this message]
2011-07-04 10:16 ` ebotcazou at gcc dot gnu.org
2011-07-04 12:38 ` jakub at gcc dot gnu.org
2011-07-04 12:40 ` jakub at gcc dot gnu.org
2011-07-04 14:31 ` sedat.dilek at gmail dot com
2011-07-04 14:39 ` sedat.dilek at gmail dot com
2011-07-04 16:49 ` sedat.dilek at gmail dot com
2011-07-04 16:50 ` sedat.dilek at gmail dot com
2011-07-04 16:51 ` sedat.dilek at gmail dot com
2011-07-04 16:52 ` sedat.dilek at gmail dot com
2011-07-04 16:52 ` sedat.dilek at gmail dot com
2011-07-04 16:55 ` sedat.dilek at gmail dot com
2011-07-05 18:44 ` jakub at gcc dot gnu.org
2011-07-05 18:45 ` jakub at gcc dot gnu.org
2011-07-05 19:13 ` jakub at gcc dot gnu.org

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=bug-49618-4-9BtSyHQS7j@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).