public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [commit] Fix PR50318 - ICE optimizing widening multiply-and-accumulate
@ 2011-09-08 20:38 Andrew Stubbs
  0 siblings, 0 replies; only message in thread
From: Andrew Stubbs @ 2011-09-08 20:38 UTC (permalink / raw)
  To: gcc-patches; +Cc: patches

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

This patch fixes PR50318 in which the compiler fails with a bad gimple 
expression.

The problem was caused by a cut-and-paste error. I don't understand why 
it wasn't caught in testing, but it's fixed now.

Committed as obvious.

Andrew

[-- Attachment #2: pr50318.patch --]
[-- Type: text/x-patch, Size: 1188 bytes --]

2011-09-08  Andrew Stubbs  <ams@codesourcery.com>

	PR tree-optimization/50318

	gcc/
	* tree-ssa-math-opts.c (convert_plusminus_to_widen): Correct
	typo in use of mult_rhs1 and mult_rhs2.

	gcc/testsuite/
	* gcc.target/arm/pr50318-1.c: New file.

--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr50318-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target arm_dsp } */
+
+long long test (unsigned int sec, unsigned long long nsecs)
+{
+   return (long long)(long)sec * 1000000000L + (long long)(unsigned
+   long)nsecs;
+}
+
+/* { dg-final { scan-assembler "umlal" } } */
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2386,9 +2386,9 @@ convert_plusminus_to_widen (gimple_stmt_iterator *gsi, gimple stmt,
 
   /* Handle constants.  */
   if (TREE_CODE (mult_rhs1) == INTEGER_CST)
-    rhs1 = fold_convert (type1, mult_rhs1);
+    mult_rhs1 = fold_convert (type1, mult_rhs1);
   if (TREE_CODE (mult_rhs2) == INTEGER_CST)
-    rhs2 = fold_convert (type2, mult_rhs2);
+    mult_rhs2 = fold_convert (type2, mult_rhs2);
 
   gimple_assign_set_rhs_with_ops_1 (gsi, wmult_code, mult_rhs1, mult_rhs2,
 				    add_rhs);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-08 19:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-08 20:38 [commit] Fix PR50318 - ICE optimizing widening multiply-and-accumulate Andrew Stubbs

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).