public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>,
	       Mikael Morin <mikael.morin@sfr.fr>,
	Jeff Law <law@redhat.com>,
	       gcc-patches <gcc-patches@gcc.gnu.org>,
	       Richard Sandiford <rdsandiford@googlemail.com>
Subject: Re: [Patch] sext_hwi: Avoid left shift of negative value undefined behaviour
Date: Thu, 13 Aug 2015 13:48:00 -0000	[thread overview]
Message-ID: <20150813134032.GM3335@redhat.com> (raw)
In-Reply-To: <CAFiYyc0saOHRP8Z6J251eUmmxQK_58=CRhxh9p1s-2G4uU7AUw@mail.gmail.com>

On Thu, Aug 13, 2015 at 01:11:53PM +0200, Richard Biener wrote:
> Rather ubsan should not complain about implementation defined behavior (or
> should separate those cases out with a different switch compared to undefined
> behavior).

I think ubsan doesn't complain about implementation-defined behavior.  It seems
to me that in this thread it only (rightfully) complained about left-shifting of
negative value. 

Using __GCC__ conditional in a case where we rely on what gcc does when
right-shifting a negative value, i.e. that it sign-extends, seems fine
(ubsan certainly doesn't error on that).

	Marek

  reply	other threads:[~2015-08-13 13:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 10:26 Mikael Morin
2015-08-11 19:49 ` Jeff Law
2015-08-12 11:01   ` Richard Biener
2015-08-12 11:07     ` Markus Trippelsdorf
2015-08-12 11:09       ` Richard Biener
2015-08-12 13:34         ` Mikael Morin
2015-08-12 17:02           ` Jeff Law
2015-08-12 17:12             ` Richard Biener
2015-08-12 18:07               ` Jeff Law
2015-08-12 18:32                 ` Richard Biener
2015-08-12 18:41                   ` Jeff Law
2015-08-12 20:07                     ` Richard Sandiford
2015-08-12 20:53                       ` Mike Stump
2015-08-13 10:11                         ` Richard Biener
2015-08-13 18:01                           ` Mike Stump
2015-08-14  7:31                             ` Richard Biener
2015-08-18 15:35                               ` Mikael Morin
2015-08-18 17:51                                 ` Jeff Law
2015-08-13 11:03                       ` Mikael Morin
2015-08-13 11:06                         ` Mikael Morin
2015-08-13 11:09                         ` Markus Trippelsdorf
2015-08-13 11:20                           ` Richard Biener
2015-08-13 13:48                             ` Marek Polacek [this message]
2015-08-13 13:55                               ` Markus Trippelsdorf
2015-08-13 13:57                                 ` Marek Polacek
2015-08-12 19:20                 ` Mike Stump

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=20150813134032.GM3335@redhat.com \
    --to=polacek@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=markus@trippelsdorf.de \
    --cc=mikael.morin@sfr.fr \
    --cc=rdsandiford@googlemail.com \
    --cc=richard.guenther@gmail.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).