diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0171-PR-c-48685.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0171-PR-c-48685.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0171-PR-c-48685.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0171-PR-c-48685.patch new file mode 100644 index 0000000..d205ca4 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0171-PR-c-48685.patch @@ -0,0 +1,43 @@ +From 260252e3308b19f495f084658236114ead218ec5 Mon Sep 17 00:00:00 2001 +From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Sat, 23 Apr 2011 10:18:54 +0000 +Subject: [PATCH 171/200] PR c/48685 + * fold-const.c (fold_convert_loc): Add NOP_EXPR when casting + to VOID_TYPE even around MODIFY_EXPR. + + * gcc.dg/pr48685.c: New test. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172896 138bc75d-0d04-0410-961f-82ee72b054a4 + +index 9a2f31f..053ae30 100644 +--- a/gcc/fold-const.c ++++ b/gcc/fold-const.c +@@ -2020,8 +2020,6 @@ fold_convert_loc (location_t loc, tree type, tree arg) + + case VOID_TYPE: + tem = fold_ignored_result (arg); +- if (TREE_CODE (tem) == MODIFY_EXPR) +- goto fold_convert_exit; + return fold_build1_loc (loc, NOP_EXPR, type, tem); + + default: +new file mode 100644 +index 0000000..36df0cc +--- /dev/null ++++ b/gcc/testsuite/gcc.dg/pr48685.c +@@ -0,0 +1,11 @@ ++/* PR c/48685 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++int ++main () ++{ ++ int v = 1; ++ (void) (1 == 2 ? (void) 0 : (v = 0)); ++ return v; ++} +-- +1.7.0.4 + |