public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: gcc-patches@gcc.gnu.org
Subject: [committed] PR 61095: tsan fallout from wide-int merge
Date: Wed, 07 May 2014 18:01:00 -0000	[thread overview]
Message-ID: <87iophqxhc.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com> (raw)

This PR was due to code in which -(int) foo was suposed to be sign-extended,
but was being ORed with an unsigned int and so ended up being zero-extended.
Fixed by using the proper-width type.

Tested on x86_64-linux-gnu and applied as obvious.  Sorry for the breakage.

Thanks,
Richard


gcc/
	PR tree-optimization/61095
	* tree-ssanames.c (get_nonzero_bits): Fix type extension in wi::shwi.

Index: gcc/tree-ssanames.c
===================================================================
--- gcc/tree-ssanames.c	2014-05-07 16:50:15.136064484 +0100
+++ gcc/tree-ssanames.c	2014-05-07 16:50:15.422063737 +0100
@@ -271,7 +271,8 @@ get_nonzero_bits (const_tree name)
     {
       struct ptr_info_def *pi = SSA_NAME_PTR_INFO (name);
       if (pi && pi->align)
-	return wi::shwi (-(int) pi->align | pi->misalign, precision);
+	return wi::shwi (-(HOST_WIDE_INT) pi->align
+			 | (HOST_WIDE_INT) pi->misalign, precision);
       return wi::shwi (-1, precision);
     }
 

             reply	other threads:[~2014-05-07 18:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 18:01 Richard Sandiford [this message]
2014-05-08  7:48 ` Richard Sandiford
2014-05-08  7:56   ` Richard Biener

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=87iophqxhc.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com \
    --to=rdsandiford@googlemail.com \
    --cc=gcc-patches@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).