Gentoo Archives: gentoo-commits

From: "Ryan Hill (rhill)" <rhill@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.9.0/gentoo: 94_all_pr60902-ffmpeg-miscompile.patch README.history
Date: Sun, 04 May 2014 18:56:08
Message-Id: 20140504185603.F216E2004C@flycatcher.gentoo.org
1 rhill 14/05/04 18:56:03
2
3 Modified: README.history
4 Added: 94_all_pr60902-ffmpeg-miscompile.patch
5 Log:
6 Add patch for PR60902.
7
8 Revision Changes Path
9 1.2 src/patchsets/gcc/4.9.0/gentoo/README.history
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/README.history?rev=1.2&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/README.history?rev=1.2&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/README.history?r1=1.1&r2=1.2
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.9.0/gentoo/README.history,v
18 retrieving revision 1.1
19 retrieving revision 1.2
20 diff -u -r1.1 -r1.2
21 --- README.history 1 May 2014 05:14:25 -0000 1.1
22 +++ README.history 4 May 2014 18:56:03 -0000 1.2
23 @@ -21,3 +21,4 @@
24 + 74_all_gcc49_cloog-dl.patch
25 + 90_all_pr55930-dependency-tracking.patch
26 + 92_all_freebsd-pie.patch
27 + + 94_all_pr60902-ffmpeg-miscompile.patch
28
29
30
31 1.1 src/patchsets/gcc/4.9.0/gentoo/94_all_pr60902-ffmpeg-miscompile.patch
32
33 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/94_all_pr60902-ffmpeg-miscompile.patch?rev=1.1&view=markup
34 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.0/gentoo/94_all_pr60902-ffmpeg-miscompile.patch?rev=1.1&content-type=text/plain
35
36 Index: 94_all_pr60902-ffmpeg-miscompile.patch
37 ===================================================================
38 http://gcc.gnu.org/PR60902
39
40
41 --- a/gcc/tree-ssa-threadedge.c
42 +++ b/gcc/tree-ssa-threadedge.c
43 @@ -387,7 +387,34 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
44 && (gimple_code (stmt) != GIMPLE_CALL
45 || gimple_call_lhs (stmt) == NULL_TREE
46 || TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME))
47 + {
48 + /* STMT might still have DEFS and we need to invalidate any known
49 + equivalences for them.
50 +
51 + Consider if STMT is a GIMPLE_ASM with one or more outputs that
52 + feeds a conditional inside a loop. We might derive an equivalence
53 + due to the conditional. */
54 + tree op;
55 + ssa_op_iter iter;
56 +
57 + if (backedge_seen)
58 + FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF)
59 + {
60 + /* This call only invalidates equivalences created by
61 + PHI nodes. This is by design to keep the cost of
62 + of invalidation reasonable. */
63 + invalidate_equivalences (op, stack, src_map, dst_map);
64 +
65 + /* However, conditionals can imply values for real
66 + operands as well. And those won't be recorded in the
67 + maps. In fact, those equivalences may be recorded totally
68 + outside the threading code. We can just create a new
69 + temporary NULL equivalence here. */
70 + record_temporary_equivalence (op, NULL_TREE, stack);
71 + }
72 +
73 continue;
74 + }
75
76 /* The result of __builtin_object_size depends on all the arguments
77 of a phi node. Temporarily using only one edge produces invalid
78 --- /dev/null
79 +++ b/gcc/testsuite/gcc.target/i386/pr60902.c
80 @@ -0,0 +1,32 @@
81 +/* { dg-do run } */
82 +/* { dg-options "-O2" } */
83 +extern void abort ();
84 +extern void exit (int);
85 +
86 +int x;
87 +
88 +foo()
89 +{
90 + static int count;
91 + count++;
92 + if (count > 1)
93 + abort ();
94 +}
95 +
96 +static inline int
97 +frob ()
98 +{
99 + int a;
100 + __asm__ ("mov %1, %0\n\t" : "=r" (a) : "m" (x));
101 + x++;
102 + return a;
103 +}
104 +
105 +int
106 +main ()
107 +{
108 + int i;
109 + for (i = 0; i < 10 && frob () == 0; i++)
110 + foo();
111 + exit (0);
112 +}