Annotation of /trunk/gcc/patches/gcc-4.9-java-regression.patch
Parent Directory | Revision Log
Revision 2436 -
(hide annotations)
(download)
Fri May 16 07:55:16 2014 UTC (10 years, 4 months ago) by niro
File size: 2116 byte(s)
Fri May 16 07:55:16 2014 UTC (10 years, 4 months ago) by niro
File size: 2116 byte(s)
-added patch to fix regressions with openjdk
1 | niro | 2436 | --- a/gcc/ipa-devirt.c 2014-04-08 07:35:11.000000000 +0200 |
2 | +++ b/gcc/ipa-devirt.c 2014-05-10 16:46:14.502859179 +0200 | ||
3 | @@ -987,6 +987,17 @@ | ||
4 | context->outer_type = expected_type; | ||
5 | context->offset = 0; | ||
6 | context->maybe_derived_type = true; | ||
7 | + context->maybe_in_construction = true; | ||
8 | + /* POD can be changed to an instance of a polymorphic type by | ||
9 | + placement new. Here we play safe and assume that any | ||
10 | + non-polymorphic type is POD. */ | ||
11 | + if ((TREE_CODE (type) != RECORD_TYPE | ||
12 | + || !TYPE_BINFO (type) | ||
13 | + || !polymorphic_type_binfo_p (TYPE_BINFO (type))) | ||
14 | + && (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST | ||
15 | + || (offset + tree_to_uhwi (TYPE_SIZE (expected_type)) <= | ||
16 | + tree_to_uhwi (TYPE_SIZE (type))))) | ||
17 | + return true; | ||
18 | return false; | ||
19 | } | ||
20 | |||
21 | --- a/gcc/testsuite/g++.dg/ipa/devirt-11.C 2013-09-08 18:42:21.000000000 +0200 | ||
22 | +++ b/gcc/testsuite/g++.dg/ipa/devirt-11.C 2014-05-10 16:46:14.503859198 +0200 | ||
23 | @@ -45,5 +45,5 @@ | ||
24 | /* While inlining function called once we should devirtualize a new call to fn2 | ||
25 | and two to fn3. While doing so the new symbol for fn2 needs to be | ||
26 | introduced. */ | ||
27 | -/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 3 "inline" } } */ | ||
28 | +/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 1 "inline" } } */ | ||
29 | /* { dg-final { cleanup-ipa-dump "inline" } } */ | ||
30 | --- a/gcc/testsuite/g++.dg/ipa/devirt-31.C 1970-01-01 01:00:00.000000000 +0100 | ||
31 | +++ b/gcc/testsuite/g++.dg/ipa/devirt-31.C 2014-05-10 16:46:14.503859198 +0200 | ||
32 | @@ -0,0 +1,23 @@ | ||
33 | +/* { dg-options "-O2 -std=c++11 -fdump-ipa-inline" } */ | ||
34 | +#include <new> | ||
35 | + | ||
36 | +class EmbeddedObject { | ||
37 | +public: | ||
38 | + virtual int val() { return 2; } | ||
39 | +}; | ||
40 | + | ||
41 | +class Container { | ||
42 | + alignas(EmbeddedObject) char buffer[sizeof(EmbeddedObject)]; | ||
43 | +public: | ||
44 | + EmbeddedObject *obj() { return (EmbeddedObject*)buffer; } | ||
45 | + Container() { new (buffer) EmbeddedObject(); } | ||
46 | +}; | ||
47 | + | ||
48 | +Container o; | ||
49 | + | ||
50 | +int main() | ||
51 | +{ | ||
52 | + __builtin_printf("%d\n", o.obj()->val()); | ||
53 | +} | ||
54 | +/* { dg-final { scan-ipa-dump-not "__builtin_unreachable" "inline" } } */ | ||
55 | +/* { dg-final { cleanup-ipa-dump "inline" } } */ |