diff options
author | Richard Biener <rguenth@gcc.gnu.org> | 2012-04-23 10:20:05 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-04-23 10:20:05 +0000 |
commit | 54b9f838faa635b6ae638cbc05195b8b181d4cc3 (patch) | |
tree | fa85561104e9e703d1204d3d9c64b27461d09acd /gcc | |
parent | e6a21dd2b9cb1a84d932a7098d98737869091171 (diff) | |
download | gcc-54b9f838faa635b6ae638cbc05195b8b181d4cc3.zip gcc-54b9f838faa635b6ae638cbc05195b8b181d4cc3.tar.gz gcc-54b9f838faa635b6ae638cbc05195b8b181d4cc3.tar.bz2 |
re PR c/53060 (Typo in build_binary_op for scalar-vector ops)
2012-04-23 Richard Guenther <rguenther@suse.de>
PR c/53060
* c-typeck.c (build_binary_op): Fix typo.
* gcc.dg/pr53060.c: New testcase.
From-SVN: r186696
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c-typeck.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr53060.c | 24 |
4 files changed, 37 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b204f82..9673a1e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 @@ -7,7 +12,8 @@ 2012-04-22 Jan Hubicka <jh@suse.cz> - * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Bail out at NULL tree refs. + * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Bail out at NULL + tree refs. 2012-04-22 Jan Hubicka <jh@suse.cz> diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 7fd2c95..fcf751f 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -9751,7 +9751,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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f1b50fa..7843587 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..3b2f193 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr53060.c @@ -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; +} |