public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PING]: PATCH: PR tree-optimization/35494: [4.4 Regression]:  Revision 132991 breaks C++ static member
@ 2008-03-10 14:56 H.J. Lu
  2008-03-10 16:17 ` H.J. Lu
  0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2008-03-10 14:56 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches

The current C++ compiler breaks C++ data member:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35494

The current patch is at

http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00572.html

It passed all tests on Linux/x86 and Linux/Intel64 as well as
483.xalancbmk. OK to install?

Thanks.


H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PING]: PATCH: PR tree-optimization/35494: [4.4 Regression]: Revision 132991 breaks C++ static member
  2008-03-10 14:56 [PING]: PATCH: PR tree-optimization/35494: [4.4 Regression]: Revision 132991 breaks C++ static member H.J. Lu
@ 2008-03-10 16:17 ` H.J. Lu
  2008-03-10 16:20   ` Richard Guenther
  2008-03-18 19:22   ` David Daney
  0 siblings, 2 replies; 5+ messages in thread
From: H.J. Lu @ 2008-03-10 16:17 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

On Mon, Mar 10, 2008 at 7:55 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> The current C++ compiler breaks C++ data member:
>
>  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35494
>
>  The current patch is at
>
>  http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00572.html
>
>  It passed all tests on Linux/x86 and Linux/Intel64 as well as
>  483.xalancbmk. OK to install?
>

Here is a smaller patch just for PR 35494. I am testing it on
Linux/x86 and Linux/Intel64 as well as 483.xalancbmk. OK to
install if all pases?

H.J.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gcc-local-7.patch --]
[-- Type: text/x-patch; name=gcc-local-7.patch, Size: 3449 bytes --]

gcc/

2008-03-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR tree-optimization/35494
	* tree-ssa-ccp.c (get_symbol_constant_value): Check if value
	may be overriden at link and run time.

gcc/testsuite/

2008-03-07  H.J. Lu  <hongjiu.lu@intel.com>

	PR tree-optimization/35494
	* g++.dg/tree-ssa/ssa-store-ccp-1.C: New.
	* gcc.dg/tree-ssa/ssa-store-ccp-2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-store-ccp-3.c: Likewise.
	* gcc.dg/tree-ssa/ssa-store-ccp-4.c: Likewise.

--- gcc/testsuite/g++.dg/tree-ssa/ssa-store-ccp-1.C.local	2008-03-08 18:11:53.000000000 -0800
+++ gcc/testsuite/g++.dg/tree-ssa/ssa-store-ccp-1.C	2008-03-08 18:11:53.000000000 -0800
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+class bar
+{
+public:
+  static const int conststaticvariable;
+};
+
+
+int f(void)
+{
+  return bar::conststaticvariable;
+}
+
+/* There should be a reference to conststaticvariable since it may
+   be overriden at link time.  */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-2.c.local	2008-03-08 18:11:53.000000000 -0800
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-2.c	2008-03-08 18:11:53.000000000 -0800
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+const int conststaticvariable;
+
+int f(void)
+{
+  return conststaticvariable;
+}
+
+/* There should be a reference to conststaticvariable since it may
+   may be overriden at link time.  */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c.local	2008-03-08 18:11:53.000000000 -0800
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c	2008-03-08 18:11:53.000000000 -0800
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-common -fdump-tree-optimized" } */
+
+const int conststaticvariable;
+
+int f(void)
+{
+  return conststaticvariable;
+}
+
+/* There should be no reference to conststaticvariable as we should have
+   inlined the 0. */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-4.c.local	2008-03-08 18:11:53.000000000 -0800
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-4.c	2008-03-08 18:11:53.000000000 -0800
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fno-common -fpic -fdump-tree-optimized" } */
+
+const int conststaticvariable;
+
+int f(void)
+{
+  return conststaticvariable;
+}
+
+/* There should be a reference to conststaticvariable since it may
+   may be overriden at run time.  */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
--- gcc/tree-ssa-ccp.c.local	2008-03-07 09:02:37.000000000 -0800
+++ gcc/tree-ssa-ccp.c	2008-03-09 06:58:50.000000000 -0700
@@ -300,7 +300,10 @@ get_symbol_constant_value (tree sym)
 {
   if (TREE_STATIC (sym)
       && TREE_READONLY (sym)
-      && !MTAG_P (sym))
+      && !MTAG_P (sym)
+      /* Check if a read-only definition may be overridden at
+	 link and run time.  */
+      && targetm.binds_local_p (sym))
     {
       tree val = DECL_INITIAL (sym);
       if (val

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PING]: PATCH: PR tree-optimization/35494: [4.4 Regression]: Revision 132991 breaks C++ static member
  2008-03-10 16:17 ` H.J. Lu
@ 2008-03-10 16:20   ` Richard Guenther
  2008-03-18 19:22   ` David Daney
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Guenther @ 2008-03-10 16:20 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Mon, Mar 10, 2008 at 5:17 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Mar 10, 2008 at 7:55 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>
> > The current C++ compiler breaks C++ data member:
>  >
>  >  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35494
>  >
>  >  The current patch is at
>  >
>  >  http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00572.html
>  >
>  >  It passed all tests on Linux/x86 and Linux/Intel64 as well as
>  >  483.xalancbmk. OK to install?
>  >
>
>  Here is a smaller patch just for PR 35494. I am testing it on
>
> Linux/x86 and Linux/Intel64 as well as 483.xalancbmk. OK to
>  install if all pases?

Yes, this is ok.

Thanks,
Richard.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PING]: PATCH: PR tree-optimization/35494: [4.4 Regression]:  Revision 132991 breaks C++ static member
  2008-03-10 16:17 ` H.J. Lu
  2008-03-10 16:20   ` Richard Guenther
@ 2008-03-18 19:22   ` David Daney
  2008-03-18 20:51     ` H.J. Lu
  1 sibling, 1 reply; 5+ messages in thread
From: David Daney @ 2008-03-18 19:22 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Richard Guenther, gcc-patches

H.J. Lu wrote:
> On Mon, Mar 10, 2008 at 7:55 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> The current C++ compiler breaks C++ data member:
>>
>>  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35494
>>
>>  The current patch is at
>>
>>  http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00572.html
>>
>>  It passed all tests on Linux/x86 and Linux/Intel64 as well as
>>  483.xalancbmk. OK to install?
>>
> 
> Here is a smaller patch just for PR 35494. I am testing it on
> Linux/x86 and Linux/Intel64 as well as 483.xalancbmk. OK to
> install if all pases?
 > gcc/
 >
 > 2008-03-08  H.J. Lu  <hongjiu.lu@intel.com>
 >
 > 	PR tree-optimization/35494
 > 	* tree-ssa-ccp.c (get_symbol_constant_value): Check if value
 > 	may be overriden at link and run time.
 >
 > gcc/testsuite/
 >
 > 2008-03-07  H.J. Lu  <hongjiu.lu@intel.com>
 >
 > 	PR tree-optimization/35494
 > 	* g++.dg/tree-ssa/ssa-store-ccp-1.C: New.
 > 	* gcc.dg/tree-ssa/ssa-store-ccp-2.c: Likewise.
 > 	* gcc.dg/tree-ssa/ssa-store-ccp-3.c: Likewise.
 > 	* gcc.dg/tree-ssa/ssa-store-ccp-4.c: Likewise.


gcc.dg/tree-ssa/ssa-store-ccp-3.c is failing on mipsel-linux:

http://gcc.gnu.org/ml/gcc-testresults/2008-03/msg01389.html

Can you fix it?

Thanks,
David Daney

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PING]: PATCH: PR tree-optimization/35494: [4.4 Regression]: Revision 132991 breaks C++ static member
  2008-03-18 19:22   ` David Daney
@ 2008-03-18 20:51     ` H.J. Lu
  0 siblings, 0 replies; 5+ messages in thread
From: H.J. Lu @ 2008-03-18 20:51 UTC (permalink / raw)
  To: David Daney; +Cc: Richard Guenther, gcc-patches

On Tue, Mar 18, 2008 at 12:14 PM, David Daney <ddaney@avtrex.com> wrote:
>
> H.J. Lu wrote:
>  > On Mon, Mar 10, 2008 at 7:55 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>  >> The current C++ compiler breaks C++ data member:
>  >>
>  >>  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35494
>  >>
>  >>  The current patch is at
>  >>
>  >>  http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00572.html
>  >>
>  >>  It passed all tests on Linux/x86 and Linux/Intel64 as well as
>  >>  483.xalancbmk. OK to install?
>  >>
>  >
>  > Here is a smaller patch just for PR 35494. I am testing it on
>  > Linux/x86 and Linux/Intel64 as well as 483.xalancbmk. OK to
>  > install if all pases?
>   > gcc/
>   >
>   > 2008-03-08  H.J. Lu  <hongjiu.lu@intel.com>
>   >
>   >      PR tree-optimization/35494
>   >      * tree-ssa-ccp.c (get_symbol_constant_value): Check if value
>   >      may be overriden at link and run time.
>   >
>   > gcc/testsuite/
>   >
>   > 2008-03-07  H.J. Lu  <hongjiu.lu@intel.com>
>   >
>   >      PR tree-optimization/35494
>   >      * g++.dg/tree-ssa/ssa-store-ccp-1.C: New.
>   >      * gcc.dg/tree-ssa/ssa-store-ccp-2.c: Likewise.
>   >      * gcc.dg/tree-ssa/ssa-store-ccp-3.c: Likewise.
>   >      * gcc.dg/tree-ssa/ssa-store-ccp-4.c: Likewise.
>
>
>  gcc.dg/tree-ssa/ssa-store-ccp-3.c is failing on mipsel-linux:
>
>  http://gcc.gnu.org/ml/gcc-testresults/2008-03/msg01389.html
>
>  Can you fix it?
>

Why does it fail on mipsel-linux? If too many targets behave differently,
I can limit it to Linux/x86.


H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-18 20:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-10 14:56 [PING]: PATCH: PR tree-optimization/35494: [4.4 Regression]: Revision 132991 breaks C++ static member H.J. Lu
2008-03-10 16:17 ` H.J. Lu
2008-03-10 16:20   ` Richard Guenther
2008-03-18 19:22   ` David Daney
2008-03-18 20:51     ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).