OSDN Git Service

2012-04-23 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Apr 2012 10:24:14 +0000 (10:24 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Apr 2012 10:24:14 +0000 (10:24 +0000)
PR c/53060
* c-typeck.c (build_binary_op): Fix typo.

* gcc.dg/pr53060.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@186698 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr53060.c [new file with mode: 0644]

index c43ff91..cb6a8f4 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-23  Richard Guenther  <rguenther@suse.de>
+
+       PR c/53060
+       * c-typeck.c (build_binary_op): Fix typo.
+
 2012-04-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimizations/52891
index 2de1e5c..1eacf03 100644 (file)
@@ -9734,7 +9734,7 @@ build_binary_op (location_t location, enum tree_code code,
              sc = convert (TREE_TYPE (type0), sc);
              op1 = build_vector_from_val (type0, sc);
              if (!maybe_const)
-               op0 = c_wrap_maybe_const (op1, true);
+               op1 = c_wrap_maybe_const (op1, true);
              orig_type1 = type1 = TREE_TYPE (op1);
              code1 = TREE_CODE (type1);
              converted = 1;
index b8ad25e..24b7f5a 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-23  Richard Guenther  <rguenther@suse.de>
+
+       PR c/53060
+       * gcc.dg/pr53060.c: New testcase.
+
 2012-04-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimizations/52891
diff --git a/gcc/testsuite/gcc.dg/pr53060.c b/gcc/testsuite/gcc.dg/pr53060.c
new file mode 100644 (file)
index 0000000..3b2f193
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int                     f(void) { return 2; }
+unsigned int            g(void) { return 5; }
+unsigned int            h = 1;
+
+typedef unsigned int vec __attribute__((vector_size(16)));
+
+vec i = { 1, 2, 3, 4};
+
+vec fv1(void) { return i + (h ? f() : g()); }
+vec fv2(void) { return (h ? f() : g()) + i; }
+
+int main()
+{
+  vec i, j;
+  j = fv1();
+  if (j[0] != 3) abort();
+  i = fv2();
+  if (i[0] != 3) abort();
+  return 0;
+}