public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amker at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/62262] aarch64 gcc generates invalid assembler
Date: Tue, 26 Aug 2014 03:24:00 -0000	[thread overview]
Message-ID: <bug-62262-4-BVDVGiOKlL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-62262-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62262

--- Comment #4 from amker at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #3)
> (In reply to amker from comment #2)
> > (In reply to Andrew Pinski from comment #1)
> > > (insn 27 26 40 5 (set (reg:SI 73 [ D.2590 ])
> > >         (and:SI (ashift:SI (reg/v:SI 74 [ value ])
> > >                 (const_int 32 [0x20]))
> > >             (const_int 8388607 [0x7fffff]))) t7.c:13 611
> > > {*andim_ashiftsi_bfiz}
> > >      (expr_list:REG_DEAD (reg/v:SI 74 [ value ])
> > >         (nil)))
> > > 
> > > Confirmed.
> > > 
> > >   "exact_log2 ((INTVAL (operands[3]) >> INTVAL (operands[2])) + 1) >= 0
> > >    && (INTVAL (operands[3]) & ((1 << INTVAL (operands[2])) - 1)) == 0"
> > > 
> > > 
> > > In fact we invoke undefined behavior inside the compiler too due to the
> > > shift there.
> > 
> > Since it's undefined code, how should we handle it in GCC?  Should we give
> > warning messages as accurate as possible?  But that sounds impractical
> > either, since "value << 1" and "value <<= zeros" could be undefined too.
> 
> Look at how other targets handle cases like this they reject patterns like
> this. I can fix this but not until next week.

Thanks very much for explaining.


  parent reply	other threads:[~2014-08-26  3:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-25 23:42 [Bug target/62262] New: " carrot at google dot com
2014-08-26  1:03 ` [Bug target/62262] " pinskia at gcc dot gnu.org
2014-08-26  2:45 ` amker at gcc dot gnu.org
2014-08-26  3:15 ` pinskia at gcc dot gnu.org
2014-08-26  3:24 ` amker at gcc dot gnu.org [this message]
2014-08-26 23:10 ` pinskia at gcc dot gnu.org
2014-08-27  1:42 ` amker at gcc dot gnu.org
2014-08-27 16:48 ` carrot at gcc dot gnu.org
2014-08-27 23:01 ` carrot at gcc dot gnu.org
2014-09-05 15:39 ` mshawcroft 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-62262-4-BVDVGiOKlL@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).