[Bug lto/41528] LTO needs better internal and user documentation

2010-04-08 Thread dnovillo at gcc dot gnu dot org


--- Comment #2 from dnovillo at gcc dot gnu dot org  2010-04-08 12:51 
---
(In reply to comment #1)
 No progress since this PR was opened. Ping.

Yes, progress has been impossible until now.  I expect to slowly getting some
content written in the next little while.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2010-04-08 12:51:11
   date||


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



[Bug other/41757] Add PLUGIN_FINISH_DECL

2009-12-22 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-12-22 19:47 
---
Proposed patch at http://gcc.gnu.org/ml/gcc-patches/2009-12/msg01032.html


-- 


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



[Bug lto/41554] New: -flto and -fwhopr should be moved to common.opt

2009-10-03 Thread dnovillo at gcc dot gnu dot org
Both options are now recognized by individual front ends.  They should be moved
to common.opt.  Individual front end validation could be done via a langhook.


-- 
   Summary: -flto and -fwhopr should be moved to common.opt
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
AssignedTo: dnovillo at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug lto/41550] New: Fix security and portability issues in lto-plugin

2009-10-02 Thread dnovillo at gcc dot gnu dot org
From http://gcc.gnu.org/ml/gcc-patches/2009-09/msg02151.html

 +static void
 +write_resolution (void)
 +{
 +  unsigned int i;
 +  FILE *f;
 +  /* FIXME: Disabled for now since we are not using the resolution file. */
 +  return;
 +
 +
 +  /* FIXME: This should be a temporary file. */
 +  f = fopen (resolution, w);

Fixed filenames like this are typically security holes.  The return above 
means this isn't, but it might be best to remove this function altogether 
until you are ready to add a version that actually does something.

 +/* Pass files generated by the lto-wrapper to the linker. FD is lto-wrapper's
 +   stdout. */
 +
 +static void
 +add_output_files (FILE *f)
 +{
 +  char fname[1000]; /* FIXME: Is this big enough? */

I don't know what sort of strings go there, but if they can be filenames 
with user-controlled components then the GNU Coding Standards say to avoid 
arbitrary limits.

 +  output_files = realloc (output_files, num_output_files * sizeof (char 
 *));
 +  output_files[num_output_files - 1] = strdup (s);

Use xrealloc and xstrdup.  Other places have the same issue with realloc 
or calloc or strdup.

 +  /* Write argv to a file to avoid a command line that is too long. */
 +  t = asprintf (at_args, @%s/arguments, temp_obj_dir_name);
 +  assert (t = 0);

This is an example of inappropriate use of assert for things that may be 
valid error conditions not a program bug.  It looks like there are others 
in this plugin.  Some cleanup work is needed.


-- 
   Summary: Fix security and portability issues in lto-plugin
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
AssignedTo: espindola at google dot com
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug lto/41547] ICEs in lto_symtab_merge_decl, at lto-symtab.c:577

2009-10-02 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-10-02 21:31 
---
Subject: Bug 41547

Author: dnovillo
Date: Fri Oct  2 21:31:43 2009
New Revision: 152422

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=152422
Log:
2009-10-02  Diego Novillo  dnovi...@google.com

* sourcebuild.texi: Document lto-plugin.
* invoke.texi: Add documentation for -use-linker-plugin
and complete documentation for -flto.
* install.texi: Document --enable-gold.

2009-10-02  Richard Guenther  rguent...@suse.de

PR lto/41547
PR lto/41548
* tree.h (is_lang_specific): Include LANG_TYPE.
* tree.c (find_decls_types_r): Manually add interesting parts
of TYPE_FIELDS.  Walk BINFO_VIRTUALS.  Do not walk TYPE_METHODS.

testsuite/ChangeLog.lto

* g++.dg/lto/20091002-1_0.C: New testcase.
* g++.dg/lto/20091002-2_0.C: Likewise..
* g++.dg/lto/20091002-3_0.C: Likewise..

2009-10-02  Diego Novillo  dnovi...@google.com

* gcc.c-torture/execute/builtins/builtins.exp: Re-enable
LTO testing.

2009-10-02  Diego Novillo  dnovi...@google.com

* lto-symtab.h: Update copyright boilerplate.
* plugin-api.h: Likewise.

2009-10-02  Diego Novillo  dnovi...@google.com

* Makefile.am (AM_CPPFLAGS): Remove -D_LARGEFILE_SOURCE
and -D_FILE_OFFSET_BITS=64.
* configure.ac: Add AC_SYS_LARGEFILE.
* configure: Regenerate.
* Makefile.in: Regenerate.
* lto-plugin.c: Fix copyright boilerplate.

2009-10-02  Diego Novillo  dnovi...@google.com

* Makefile.am (ACLOCAL_AMFLAGS): Define.
* aclocal.m4: Regenerate with aclocal-2.64
* acinclude.m4: Remove.
* Makefile.in: Regenerate with automake-1.11
* configure.ac (AC_PREREQ): Update to 2.64.
* configure: Regenerate.



Added:
branches/lto/gcc/testsuite/g++.dg/lto/20091002-1_0.C
branches/lto/gcc/testsuite/g++.dg/lto/20091002-2_0.C
branches/lto/gcc/testsuite/g++.dg/lto/20091002-3_0.C
Removed:
branches/lto/lto-plugin/acinclude.m4
Modified:
branches/lto/gcc/ChangeLog.lto
branches/lto/gcc/doc/install.texi
branches/lto/gcc/doc/invoke.texi
branches/lto/gcc/doc/sourcebuild.texi
branches/lto/gcc/testsuite/ChangeLog.lto
branches/lto/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
branches/lto/gcc/tree.c
branches/lto/gcc/tree.h
branches/lto/include/ChangeLog.lto
branches/lto/include/lto-symtab.h
branches/lto/include/plugin-api.h
branches/lto/lto-plugin/ChangeLog
branches/lto/lto-plugin/Makefile.am
branches/lto/lto-plugin/Makefile.in
branches/lto/lto-plugin/aclocal.m4
branches/lto/lto-plugin/configure
branches/lto/lto-plugin/configure.ac
branches/lto/lto-plugin/lto-plugin.c


-- 


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



[Bug lto/41548] ICE: tree code 'lang_type' is not supported in gimple streams

2009-10-02 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-10-02 21:31 
---
Subject: Bug 41548

Author: dnovillo
Date: Fri Oct  2 21:31:43 2009
New Revision: 152422

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=152422
Log:
2009-10-02  Diego Novillo  dnovi...@google.com

* sourcebuild.texi: Document lto-plugin.
* invoke.texi: Add documentation for -use-linker-plugin
and complete documentation for -flto.
* install.texi: Document --enable-gold.

2009-10-02  Richard Guenther  rguent...@suse.de

PR lto/41547
PR lto/41548
* tree.h (is_lang_specific): Include LANG_TYPE.
* tree.c (find_decls_types_r): Manually add interesting parts
of TYPE_FIELDS.  Walk BINFO_VIRTUALS.  Do not walk TYPE_METHODS.

testsuite/ChangeLog.lto

* g++.dg/lto/20091002-1_0.C: New testcase.
* g++.dg/lto/20091002-2_0.C: Likewise..
* g++.dg/lto/20091002-3_0.C: Likewise..

2009-10-02  Diego Novillo  dnovi...@google.com

* gcc.c-torture/execute/builtins/builtins.exp: Re-enable
LTO testing.

2009-10-02  Diego Novillo  dnovi...@google.com

* lto-symtab.h: Update copyright boilerplate.
* plugin-api.h: Likewise.

2009-10-02  Diego Novillo  dnovi...@google.com

* Makefile.am (AM_CPPFLAGS): Remove -D_LARGEFILE_SOURCE
and -D_FILE_OFFSET_BITS=64.
* configure.ac: Add AC_SYS_LARGEFILE.
* configure: Regenerate.
* Makefile.in: Regenerate.
* lto-plugin.c: Fix copyright boilerplate.

2009-10-02  Diego Novillo  dnovi...@google.com

* Makefile.am (ACLOCAL_AMFLAGS): Define.
* aclocal.m4: Regenerate with aclocal-2.64
* acinclude.m4: Remove.
* Makefile.in: Regenerate with automake-1.11
* configure.ac (AC_PREREQ): Update to 2.64.
* configure: Regenerate.



Added:
branches/lto/gcc/testsuite/g++.dg/lto/20091002-1_0.C
branches/lto/gcc/testsuite/g++.dg/lto/20091002-2_0.C
branches/lto/gcc/testsuite/g++.dg/lto/20091002-3_0.C
Removed:
branches/lto/lto-plugin/acinclude.m4
Modified:
branches/lto/gcc/ChangeLog.lto
branches/lto/gcc/doc/install.texi
branches/lto/gcc/doc/invoke.texi
branches/lto/gcc/doc/sourcebuild.texi
branches/lto/gcc/testsuite/ChangeLog.lto
branches/lto/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
branches/lto/gcc/tree.c
branches/lto/gcc/tree.h
branches/lto/include/ChangeLog.lto
branches/lto/include/lto-symtab.h
branches/lto/include/plugin-api.h
branches/lto/lto-plugin/ChangeLog
branches/lto/lto-plugin/Makefile.am
branches/lto/lto-plugin/Makefile.in
branches/lto/lto-plugin/aclocal.m4
branches/lto/lto-plugin/configure
branches/lto/lto-plugin/configure.ac
branches/lto/lto-plugin/lto-plugin.c


-- 


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



[Bug lto/41526] New: gimple bytecode streams are not portable between different hosts

2009-09-30 Thread dnovillo at gcc dot gnu dot org
From http://gcc.gnu.org/ml/gcc-patches/2009-09/msg02148.html

I can see some issues here with output portability that should be 
addressed for objects with LTO information to be portable between hosts.

1. There are some structures lto_*header that include 16-bit or 32-bit 
integer fields (plus an enum).  It appears that the byte sequences for 
these headers get written out verbatim eithout regard for endianness 
issues, and reading in a file written on a host with the other endianness 
will result in an assertion failure.  Regarding the appropriateness of an 
assertion failure here see my comments on error handling, but it should 
not be hard to write out each field explicitly with defined endianness 
that does not depend on the endianness of the host.  There are other 
places writing out individual integers like this (at least 
write_global_references, lto_output_decl_state_refs, write_symbol_vec) 
that will also need fixing.

2. The storing of values in bitpacks may depend on the number of bits in 
various types.  I haven't looked at whether how the integers of size 
BITS_PER_BITPACK_WORD = HOST_BITS_PER_WIDE_INT are then written out to see 
whether the host endianness is also relevant there; if it is, that should 
be addressed.

  (a) The cases where HOST_BITS_PER_WIDE_INT bits are stored in a bitpack 
  would most simply be addressed by making LTO imply 64-bit (exactly) 
  HOST_WIDE_INT for all hosts and targets.  (I'd be happy for 
  HOST_WIDE_INT to be made 64-bit everywhere whether or not LTO is 
  enabled, in the interests of avoiding host-dependency in code 
  generation, but making it so for LTO may be less controversial.)

  (b) We can reasonably assume HOST_BITS_PER_INT to be 32, and 
  HOST_BITS_PER_SHORT to be 16, for all hosts, but a static assertion that 
  these are so if building LTO would ensure no problems arise with it 
  building but producing bad objects on unusual hosts.  Likewise for the 
  case using sizeof (unsigned) * 8.

  (c) REAL_CSTs, writing out HOST_BITS_PER_LONG bits, may take more care.  
  The obvious way is to encode them in target format before writing out, 
  then decode when reading in.


-- 
   Summary: gimple bytecode streams are not portable between
different hosts
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug lto/41526] gimple bytecode streams are not portable between different hosts

2009-09-30 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-09-30 19:50 
---
Other portability concerns:

http://gcc.gnu.org/ml/gcc-patches/2009-09/msg02157.html

 The host portability issue with __attribute__ ((visibility (hidden))) 
 has already been noted.  I suggest conditioning the attributes on defined 
 (__GNUC__)  defined (__ELF__) - GCC should support the attribute on ELF 
 hosts, but LTO should also work for ELF targets with non-ELF hosts.

and

http://gcc.gnu.org/ml/gcc-patches/2009-09/msg02190.html

  The host portability issue with __attribute__ ((visibility (hidden))) 
  has already been noted.  I suggest conditioning the attributes on defined 
  (__GNUC__)  defined (__ELF__) - GCC should support the attribute on ELF 
  hosts, but LTO should also work for ELF targets with non-ELF hosts.

 Unfortunately, neither is true: older versions of GCC on Solaris 2 didn't
 support hidden with the vendor linker.  This was only fixed in GCC 4.4.0
 for Solaris 9 and up.  And IRIX 6 doesn't support hidden at all: the vendor
 linker knows nothing about it; maybe it can be made to work by using GNU
 ld, but I'm unsure if rld (runtime linker) support is needed as well.
 
 Cf. PR bootstrap/39020 and bootstrap/39021.


-- 


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



[Bug lto/41526] gimple bytecode streams are not portable between different hosts

2009-09-30 Thread dnovillo at gcc dot gnu dot org


--- Comment #2 from dnovillo at gcc dot gnu dot org  2009-09-30 20:17 
---
More portability concerns from

http://gcc.gnu.org/ml/gcc-patches/2009-09/msg02157.html

 +/* This needs to be included after config.h.  Otherwise, _GNU_SOURCE will not
 +   be defined in time to set __USE_GNU in the system headers, and strsignal
 +   will not be declared.  */
 +#include sys/mman.h

mmap and sys/mman.h are also not portable to all supported hosts (e.g. 
MinGW).  There should be configure tests and a suitable fallback.


-- 


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



[Bug lto/41528] New: LTO needs better internal and user documentation

2009-09-30 Thread dnovillo at gcc dot gnu dot org
 information.

* Are there particular things about objects in the program that will 
inhibit LTO optimizations, either globally or for a particular object (as 
if it did not have LTO information)?  Toplevel asms?  
-fno-toplevel-reorder?  Particular combinations of options or declarations 
in different objects?

* When can I use different options for different objects being optimized 
together?  Can I build just one object with -frounding-math and have that 
work?  Different objects with -fwrapv and -ftrapv?  Suppose my program has 
multiple versions of a function built for different CPUs and a dispatching 
function - or use of STT_GNU_IFUNC - to select one at runtime based on the 
CPU in use.  Will compiling different files with different CPU options, or 
using the target attribute, work properly with LTO, at least as long as 
the CPU-specific functions are marked noinline so the compiler can know 
not to move CPU-specific functionality into the caller before the CPU 
checks?


I would expect some changes to be needed to passes.texi as well to discuss 
LTO.  Certainly, it would be good to have some sort of overview of the 
workings of LTO and how data is arranged in object files that is checked 
into the GCC sources and branched along with GCC, whether in the internals 
manual or in comments in the sources (I haven't yet looked at the patches 
with the bulk of the LTO sources to see if there are suitable comments 
there); a wiki page that has moved on to describing new arrangements for 
4.6 is of less use when fixing a bug on 4.5 branch.  But this is secondary 
to getting a proper description for users of how to use LTO.


-- 
   Summary: LTO needs better internal and user documentation
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
AssignedTo: dnovillo at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug lto/41529] New: LTO configuration should detect if the target is ELF

2009-09-30 Thread dnovillo at gcc dot gnu dot org
From http://gcc.gnu.org/ml/gcc-patches/2009-09/msg02106.html

 You enable LTO by default if a suitable libelf is found.  But what if
 libelf is present but the target for which GCC is being configured is not
 an ELF target?  Presumably LTO will not work in that case (i.e., it
 requires the target to be an ELF target rather than producing ELF files
 separate from the normal objects for that target)?  So shouldn't LTO be
 disabled for non-ELF targets even when libelf is present?  We discussed a
 patch to do that back in May (e.g.
 http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01609.html); what happened
 to that?  (On the whole I think a blacklist of targets that are (a)
 supported by GCC and (b) not ELF is better than trying to list all ELF
 targets.  Certainly various ELF targets are missing from the list used to
 set is_elf for --enable-gold.)


-- 
   Summary: LTO configuration should detect if the target is ELF
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
AssignedTo: dnovillo at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug bootstrap/41336] [LTO] Bootstrap failed on RHEL5/ia32 and RHEL5/ia64

2009-09-28 Thread dnovillo at gcc dot gnu dot org


--- Comment #5 from dnovillo at gcc dot gnu dot org  2009-09-28 16:24 
---
Should be fixed now.  We now test for libelf features during configuration. 
Please reopen if it still fails.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug lto/40739] [LTO] ICE in bp_pack_value, at lto-streamer.c:336

2009-07-14 Thread dnovillo at gcc dot gnu dot org


--- Comment #4 from dnovillo at gcc dot gnu dot org  2009-07-14 21:41 
---

This is likely fixed by
http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00819.html,
could you try again?


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-07-14 07:06:28 |2009-07-14 21:41:56
   date||


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



[Bug other/31567] cc1, cc1plus, etc. don't support @file mechanism

2009-04-17 Thread dnovillo at gcc dot gnu dot org


--- Comment #2 from dnovillo at gcc dot gnu dot org  2009-04-17 20:51 
---
Proposed patch: http://gcc.gnu.org/ml/gcc-patches/2009-04/msg01379.html


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-04-17 20:51:08
   date||


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



[Bug other/31567] cc1, cc1plus, etc. don't support @file mechanism

2009-04-17 Thread dnovillo at gcc dot gnu dot org


--- Comment #3 from dnovillo at gcc dot gnu dot org  2009-04-17 21:12 
---
Subject: Bug 31567

Author: dnovillo
Date: Fri Apr 17 21:11:46 2009
New Revision: 146292

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=146292
Log:

PR 31567
* gcc.c (create_at_file): New.
(compile_input_file_p): New.
(do_spec_1): Use @args files for %i. Use create_at_file for %o.
* main.c (main): Update call to toplev_main.
* toplev.c (toplev_main): Change signature. Call expandargv.
* toplev.h (toplev_main): Change signature.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/gcc.c
trunk/gcc/main.c
trunk/gcc/toplev.c
trunk/gcc/toplev.h


-- 


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



[Bug other/31567] cc1, cc1plus, etc. don't support @file mechanism

2009-04-17 Thread dnovillo at gcc dot gnu dot org


--- Comment #4 from dnovillo at gcc dot gnu dot org  2009-04-17 21:13 
---
Fixed.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug bootstrap/39001] lto branch doesn't build

2009-04-04 Thread dnovillo at gcc dot gnu dot org


--- Comment #10 from dnovillo at gcc dot gnu dot org  2009-04-04 12:40 
---

Fixed.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/39506] PTA TBAA pruning wrong for -fargument-noalias-*

2009-03-19 Thread dnovillo at gcc dot gnu dot org


--- Comment #6 from dnovillo at gcc dot gnu dot org  2009-03-19 17:12 
---
(In reply to comment #5)

 I agree with pinskia, and think this should be closed as invalid.

Likewise.  At most we could emit a warning when we see p = i.


Diego.


-- 


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



[Bug tree-optimization/39203] LTO and -fwhole-program do not play along well

2009-02-17 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-02-17 16:15 
---

I think the easiest way to handle this would be for the driver to disable
-fwhole-program when the IL is being generated.  Otherwise, all the symbols are
privatized.


-- 


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



[Bug lto/39000] internal compiler error: in output_expr_operand, at lto-function-out.c:1200

2009-02-17 Thread dnovillo at gcc dot gnu dot org


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-01-28 20:11:25 |2009-02-17 16:19:30
   date||


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



[Bug tree-optimization/39203] LTO and -fwhole-program do not play along well

2009-02-17 Thread dnovillo at gcc dot gnu dot org


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-02-17 16:20:07
   date||


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



[Bug tree-optimization/39203] LTO and -fwhole-program do not play along well

2009-02-17 Thread dnovillo at gcc dot gnu dot org


--- Comment #10 from dnovillo at gcc dot gnu dot org  2009-02-17 21:38 
---
Subject: Bug 39203

Author: dnovillo
Date: Tue Feb 17 21:38:05 2009
New Revision: 144248

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144248
Log:
2009-02-17  Diego Novillo  dnovi...@google.com

PR 39203
* c-opts.c (c_common_post_options): Disable -fwhole-program
when generating IL.

lto/ChangeLog

PR 39203
* lto-lang.c (lto_post_options): Disable -fwhole-program
when running LTRANS.



Modified:
branches/lto/gcc/ChangeLog.lto
branches/lto/gcc/c-opts.c
branches/lto/gcc/lto/ChangeLog
branches/lto/gcc/lto/lto-lang.c


-- 


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



[Bug bootstrap/39001] lto branch doesn't build

2009-02-04 Thread dnovillo at gcc dot gnu dot org


--- Comment #4 from dnovillo at gcc dot gnu dot org  2009-02-04 17:49 
---
Testing patch with the more straightforward of the two suggestions from Cary:
http://gcc.gnu.org/ml/gcc/2009-01/msg00105.html


-- 


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



[Bug bootstrap/39001] lto branch doesn't build

2009-02-04 Thread dnovillo at gcc dot gnu dot org


--- Comment #5 from dnovillo at gcc dot gnu dot org  2009-02-04 18:06 
---
Subject: Bug 39001

Author: dnovillo
Date: Wed Feb  4 18:05:51 2009
New Revision: 143935

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143935
Log:

PR 39001
* toplev.c (eh_personality_decl): Fix comment.
* dwarf2out.c (dwarf2out_do_cfi_asm): Return true if
current_function_decl is NULL.


Modified:
branches/lto/gcc/ChangeLog.lto
branches/lto/gcc/dwarf2out.c
branches/lto/gcc/toplev.c


-- 


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



[Bug bootstrap/39001] lto branch doesn't build

2009-02-04 Thread dnovillo at gcc dot gnu dot org


--- Comment #6 from dnovillo at gcc dot gnu dot org  2009-02-04 21:23 
---

The recent patch only fixes the case for x86_64.  This is still broken on ppc. 
Will try to implement the first suggestion from
http://gcc.gnu.org/ml/gcc/2009-01/msg00074.html

/* confdefs.h.  */

#define PACKAGE_NAME GNU C Runtime Library
#define PACKAGE_TARNAME libgcc
#define PACKAGE_VERSION 1.0
#define PACKAGE_STRING GNU C Runtime Library 1.0
#define PACKAGE_BUGREPORT 
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}

$ /home/dnovillo/lto/native/bld/./gcc/xgcc
-B/home/dnovillo/lto/native/bld/./gcc/
-B/home/dnovillo/lto/native/powerpc64-unknown-linux-gnu/bin/
-B/home/dnovillo/lto/native/powerpc64-unknown-linux-gnu/lib/ -isystem
/home/dnovillo/lto/native/powerpc64-unknown-linux-gnu/include -isystem
/home/dnovillo/lto/native/powerpc64-unknown-linux-gnu/sys-include -c -g -O2   
conftest.c 5
conftest.c:16: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.


-- 


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



[Bug lto/39010] [LTO] Memory corruption on gcc.c-torture/compile/limits-fndefn.c

2009-01-31 Thread dnovillo at gcc dot gnu dot org


--- Comment #5 from dnovillo at gcc dot gnu dot org  2009-01-31 18:49 
---
Subject: Bug 39010

Author: dnovillo
Date: Sat Jan 31 18:49:10 2009
New Revision: 143828

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143828
Log:

Revert

2009-01-30  H.J. Lu  hongjiu...@intel.com

PR lto/39010
* lto-function-out.c (output_string): Properly handle the
trailing '\0'.
(output_tree_flags): Updated.


Modified:
branches/lto/gcc/ChangeLog.lto
branches/lto/gcc/lto-function-out.c


-- 


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



[Bug lto/39010] [LTO] Memory corruption on gcc.c-torture/compile/limits-fndefn.c

2009-01-31 Thread dnovillo at gcc dot gnu dot org


--- Comment #6 from dnovillo at gcc dot gnu dot org  2009-01-31 18:51 
---

The patch 

2009-01-30  H.J. Lu  hongjiu...@intel.com

PR lto/39010
* lto-function-out.c (output_string): Properly handle the
trailing '\0'.
(output_tree_flags): Updated.

caused 478 new regressions in the testsuite.  Reverted.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|FIXED   |


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



[Bug bootstrap/39001] lto branch doesn't build

2009-01-28 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-01-28 13:41 
---

Additional information on the failure and a suggestion on a possible fix:

http://gcc.gnu.org/ml/gcc/2009-01/msg00074.html


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-01-28 13:41:30
   date||


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



[Bug middle-end/39004] Revision 143730 breaks LTO

2009-01-28 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-01-28 15:05 
---
Subject: Bug 39004

Author: dnovillo
Date: Wed Jan 28 15:05:16 2009
New Revision: 143731

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143731
Log:

PR middle-end/39004
* lto-function-in.c (input_local_var_decl): Remove unused
locals CONTEXT_TAG and CONTEXT.


Modified:
branches/lto/gcc/ChangeLog.lto
branches/lto/gcc/lto-function-in.c


-- 


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



[Bug middle-end/39004] Revision 143730 breaks LTO

2009-01-28 Thread dnovillo at gcc dot gnu dot org


--- Comment #2 from dnovillo at gcc dot gnu dot org  2009-01-28 15:17 
---

Fixed.  http://gcc.gnu.org/ml/gcc-patches/2009-01/msg01367.html


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug bootstrap/39011] lto bootstrap failure on ppc-linux

2009-01-28 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-01-28 21:08 
---

This is the same issue reported in 39001, except that it happens on a different
file.

*** This bug has been marked as a duplicate of 39001 ***


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


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



[Bug bootstrap/39001] lto branch doesn't build

2009-01-28 Thread dnovillo at gcc dot gnu dot org


--- Comment #3 from dnovillo at gcc dot gnu dot org  2009-01-28 21:08 
---
*** Bug 39011 has been marked as a duplicate of this bug. ***


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||andreast at gcc dot gnu dot
   ||org


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



[Bug bootstrap/38992] [LTO] Bootstrap failed on RHEL5/ia32 and RHEL5/ia64

2009-01-27 Thread dnovillo at gcc dot gnu dot org


--- Comment #2 from dnovillo at gcc dot gnu dot org  2009-01-27 22:10 
---
The libelf included in Red Hat based distros is different than the one we used
to develop LTO.  There was a thread on IRC recently where Jakub proposed a way
of working around this:

(16:27:18) jakub: dnovillo: very user visible difference is e.g. for
LFS on 32-bit arches
(16:28:25) dnovillo: jakub: we have exactly one problem with fedora's
libelf.  It doesn't support one of the functions that exists in the
other libelf that we use.  Ian suggested a way of implementing it
using fedora's facilities, but I've never bothered yet.
(16:29:24) jakub: dnovillo: which one it is?  If it is a sane API, no
problem suggesting Uli or Roland to add it
(16:30:03) dnovillo: jakub: elfx_update_shstrndx
(16:30:28) dnovillo: ian says that it can be implemented using
gelf_update_ehdr.
(16:30:48) dnovillo: i never got around to trying it, so i don't know
more details.
(16:31:45) dnovillo: i'll send mail to roland/uli, thanks.
(16:34:57) jakub: dnovillo: only elf{,32,64}_ and gelf_ prefixes are
standard SGI libelf
(16:35:09) jakub: dnovillo: elfx_ must be some weirdo extension
(16:43:03) jakub: dnovillo: I fail to see what is that
elfx_update_shstrndx good for?  Just gelf_getehdr, modify the field,
gelf_update_ehdr
(16:43:03) jakub: dnovillo: if for every field we had such a wrapper,
what would we gain?
(16:45:18) dnovillo: jakub: as i said, i don't know.  i don't know
libelf and i didn't write this code.


-- 


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



[Bug bootstrap/38994] [LTO] lto1 isn't built when configured with --enable-languages=c,c++,fortran

2009-01-27 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2009-01-27 23:00 
---

No, of course not.  This is by design.  The lto1 binary is the front end for
GIMPLE, as with any other front end, it has to be specifically requested when
configuring the compiler.  You have to add 'lto' to the list of languages (more
details at http://gcc.gnu.org/wiki/LinkTimeOptimization).

We should probably change the name from 'lto' to 'gimple', as that is the name
of the language that lto1 reads, but that's just a minor detail.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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



[Bug middle-end/37843] [4.4 Regression] unaligned stack in main due to tail call optimization

2009-01-15 Thread dnovillo at gcc dot gnu dot org


--- Comment #25 from dnovillo at gcc dot gnu dot org  2009-01-15 15:23 
---
(In reply to comment #24)
 Created an attachment (id=17107)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17107action=view) [edit]
 Here is the updated patch.

OK.


Diego.


-- 


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



[Bug c++/37352] thunks for virtual function should work on lto

2008-12-31 Thread dnovillo at gcc dot gnu dot org


--- Comment #5 from dnovillo at gcc dot gnu dot org  2008-12-31 19:32 
---

Initial fix at http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00953.html
Keeping open as thunks with varargs are still broken.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|maddox at google dot com|
 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2008-12-31 19:26:06 |2008-12-31 19:32:54
   date||


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



[Bug c++/38178] [LTO] devirtualization is missing in lto

2008-11-20 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2008-11-20 18:47 
---
Subject: Bug 38178

Author: dnovillo
Date: Thu Nov 20 18:45:58 2008
New Revision: 142055

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=142055
Log:
2008-11-20  Rafael Espindola  [EMAIL PROTECTED]
Diego Novillo  [EMAIL PROTECTED]

PR 38178
* tree.c (reset_type_lang_specific): Set TYPE_BINFO to
NULL.

cp/ChangeLog.lto

PR 38178
* cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Undefine.

testsuite/ChangeLog.lto:

PR 38178
* g++.dg/lto/20081119_0.C: New.
* g++.dg/lto/20081119_1.C: New.
* g++.dg/opt/devirt1.C: Do not scan for the devirtualized
call.



Added:
branches/lto/gcc/testsuite/g++.dg/lto/20081119_0.C
branches/lto/gcc/testsuite/g++.dg/lto/20081119_1.C
Modified:
branches/lto/gcc/ChangeLog.lto
branches/lto/gcc/cp/ChangeLog.lto
branches/lto/gcc/cp/cp-lang.c
branches/lto/gcc/testsuite/ChangeLog.lto
branches/lto/gcc/testsuite/g++.dg/opt/devirt1.C
branches/lto/gcc/tree.c


-- 


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



[Bug tree-optimization/37421] New: ICE in vn_reference_insert_pieces at tree-ssa-sccvn.c:1131

2008-09-08 Thread dnovillo at gcc dot gnu dot org
Found with this test case.  Still have not analyzed it, so I'm not quite sure
where we're getting confused:

#include stdio.h
#include string.h

inline int
bci (const float source)
{
 int dest;
 memcpy (dest, source, sizeof (dest));
 return dest;
}

inline float
bcf (const int source)
{
 float dest;
 memcpy (dest, source, sizeof (dest));
 return dest;
}

float
Foo ()
{
 const int foo = bci (0.0f);
 int bar = foo;
 const int baz = foo  1;
 if (!baz  (foo  2))
   bar = 0;
 return bcf (bar);
}

main ()
{
  printf (Foo() = %f\n, Foo());
}

$ mainline/bin/g++ -o mathutil -O2 mathutil.cc
mathutil.cc: In function 'float Foo()':
mathutil.cc:21: internal compiler error: in vn_reference_insert_pieces, at
tree-ssa-sccvn.c:1131
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.


-- 
   Summary: ICE in vn_reference_insert_pieces at tree-ssa-
sccvn.c:1131
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug tree-optimization/37421] [4.4 Regression] ICE in vn_reference_insert_pieces at tree-ssa-sccvn.c:1131

2008-09-08 Thread dnovillo at gcc dot gnu dot org


--- Comment #7 from dnovillo at gcc dot gnu dot org  2008-09-08 20:13 
---
Subject: Bug 37421

Author: dnovillo
Date: Mon Sep  8 20:12:38 2008
New Revision: 140119

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=140119
Log:
2008-09-08  Diego Novillo  [EMAIL PROTECTED]

* tree-ssa-pre.c (gate_pre): Re-enable.

Bring from mainline @140111

2008-09-08  Richard Guenther  [EMAIL PROTECTED]

PR tree-optimization/37421
* tree-ssa-sccvn.c (visit_copy): Make sure to fully
valueize the RHS.

testsuite/ChangeLog.lto:

2008-09-08  Diego Novillo  [EMAIL PROTECTED]

Bring from mainline @140111

2008-09-08  Richard Guenther  [EMAIL PROTECTED]

PR tree-optimization/37421
* g++.dg/torture/pr37421.C: New testcase.

* gcc.dg/lto/lto.exp: Add -pedantic-errors.
* g++.dg/lto/lto.exp: Likewise.
* g++.dg/lto/20080908-1.C: Fix return value of main().
* g++.dg/lto/20080908-3.C: Likewise.



Added:
branches/lto/gcc/testsuite/g++.dg/torture/pr37421.C
  - copied unchanged from r140111,
trunk/gcc/testsuite/g++.dg/torture/pr37421.C
Modified:
branches/lto/gcc/ChangeLog.lto
branches/lto/gcc/testsuite/ChangeLog.lto
branches/lto/gcc/testsuite/g++.dg/lto/20080908-1.C
branches/lto/gcc/testsuite/g++.dg/lto/20080908-3.C
branches/lto/gcc/testsuite/g++.dg/lto/lto.exp
branches/lto/gcc/testsuite/gcc.dg/lto/lto.exp
branches/lto/gcc/tree-ssa-pre.c
branches/lto/gcc/tree-ssa-sccvn.c


-- 


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



[Bug tree-optimization/36245] [4.4 Regression] internal compiler error: in build2_stat, at tree.c:3116

2008-06-11 Thread dnovillo at gcc dot gnu dot org


--- Comment #14 from dnovillo at gcc dot gnu dot org  2008-06-11 15:39 
---
Subject: Bug 36245

Author: dnovillo
Date: Wed Jun 11 15:39:09 2008
New Revision: 136672

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136672
Log:
2008-06-11  Diego Novillo  [EMAIL PROTECTED]

Merge from lto-streamer sub-branch:

2008-06-09  Bill Maddox  [EMAIL PROTECTED]

* lto-tags.h: Add new tags LTO_local_type_ref
and LTO_global_type_ref.  Split LTO_type_decl
and LTO_field_decl into LTO_type_decl0, LTO_type_decl1,
LTO_field_decl0, and LTO_field_decl1.
* lto-tree-tags.h: Set names and tree code mappings for
the new tags.
* lto-function-out.c: Tidy comments and formatting.
(output_record_start): Add forward declaration.
(type_function_context): New function.
(field_decl_is_local, type_decl_is_local): New functions.
(output_type_ref_1): Write local (e.g., variably-modified)
types to local_decls stream.
(output_type_ref): Use type_ref as debug token to avoid
confusing clash with use of type elsewhere.
(output_local_decl_ref):  Update comment.
(output_expr_operand): Cases for FIELD_DECL and TYPE_DECL
now write local declarations to local_decls stream.
(output_local_var):  Rename to output_local_var_decl.
(output_local_var_decl): Remove code to set slot in
local_decls_index, now handled by output_local_decl.
(output_local_tree): New function.
(output_local_field_decl, output_local_type_decl,
output_local_type): New functions.
(output_local_decl): New function.
(output_field_decl): Use new tag LTO_field_decl1, to
distinguish from local fields.
(output_type_decl): Use new tag LTO_type_decl1, to
distinguish from local fields.
* lto-function-in.c: Tidy comments and formatting.
(input_local_tree, input_local_var_decl,
input_local_field_decl,
input_local_type_decl, input_local_type):  Add
forward declarations.
(input_type_ref_1): Distinguish references to global or local
declaration streams.
(input_type_ref):  Use type_ref as debug token to avoid
confusing clash with use of type elsewhere.
(input_expr_operand):  Cases for FIELD_DECL and TYPE_DECL
now read local declarations from local_decls stream.
(input_local_tree): New function.
(input_local_var): Rename to input_local_var_decl.
(input_local_var_decl): Input record tag is now an argument.
(input_local_field_decl, input_local_type_decl,
input_local_type): New functions.
(input_local_decl): New function.
(input_local_vars): Call input_local_decl instead
of input_local_var.
(lto_static_init_local): Don't call
add_referenced_var on non-vars.
* lto-section-out.c (lto_hash_decl_slot_node,
lto_eq_decl_slot_node): Use object pointer, not
UID, as hash key.

2008-06-04  Rafael Espindola  [EMAIL PROTECTED]

* lto-function-out.c (output_tree): call error
with the TREE_CODE name.

2008-06-04  Ollie Wild  [EMAIL PROTECTED]

* dwarf2out.c (dwarf2_called_from_lto_p): Remove.
(current_fde): New function.
(add_fde_cfi): Call current_fde.
(lookup_cfa): Call curent_fde.
(dwarf2out_end_epilogue): Call current_fde.
(dwarf2out_switch_text_section: Call current_fde.
(lto_void_type_die): Remove.
(dwarf_attr_name): Declare static.  Remove
flag_generate_lto check.

(assign_symbol_name): Remove.
(assign_symbol_names): Expand call to assign_symbol_name.
(base_type_die): Replace
DW_ATE_GNU_complex_unsigned and
DW_ATE_GNU_complex_signed encodings with
DW_ATE_lo_user.  Remove byte_size computation.
Remove extra precision information.
(may_reference_to_unused): Rename reference_to_unused.
(rtl_for_decl_init): Rename calls to may_reference_to_unused.
(convert_cfa_to_fb_loc_list): Call current_fde.
(gen_subprogram_die): Remove flag_generate_lto and
dwarf2_called_from_lto_p checks.
(gen_variable_die): Remove context_die == comp_unit_die checks.
(add_high_low_attributes): Remove

[Bug middle-end/36184] gimple-tuples-branch fails bootstrap on x86 Darwin

2008-06-02 Thread dnovillo at gcc dot gnu dot org


--- Comment #3 from dnovillo at gcc dot gnu dot org  2008-06-02 17:04 
---
Fixed. http://gcc.gnu.org/ml/gcc-patches/2008-05/msg02061.html.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/36245] [4.4 Regression] internal compiler error: in build2_stat, at tree.c:3116

2008-05-30 Thread dnovillo at gcc dot gnu dot org


--- Comment #13 from dnovillo at gcc dot gnu dot org  2008-05-30 16:12 
---
Subject: Bug 36245

Author: dnovillo
Date: Fri May 30 16:11:58 2008
New Revision: 136212

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=136212
Log:
2008-05-30  Diego Novillo  [EMAIL PROTECTED]

Backport from trunk:

2008-05-27  Richard Guenther  [EMAIL PROTECTED]

PR tree-optimization/36245
* tree-ssa-address.c (add_to_parts): Deal with non-pointer
bases.



Modified:
branches/lto-streamer/gcc/ChangeLog.lto
branches/lto-streamer/gcc/tree-ssa-address.c


-- 


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



[Bug c++/33738] -Wtype-limits misses a warning when comparing enums

2008-03-10 Thread dnovillo at gcc dot gnu dot org


--- Comment #10 from dnovillo at gcc dot gnu dot org  2008-03-11 05:56 
---

Fixed on mainline (4.4).


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


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



[Bug other/35486] Can't build gimple-tuples-branch

2008-03-06 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2008-03-06 20:01 
---

Thanks.  This is known and I'm working on a fix.  In the meantime, you can get
a clean build of the branch if you configure with --disable-bootstrap
--disable-libmudflap --disable-libgomp --enable-languages=c,fortran.


-- 


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



[Bug c++/33738] -Wtype-limits misses a warning when comparing enums

2008-02-24 Thread dnovillo at gcc dot gnu dot org


--- Comment #9 from dnovillo at gcc dot gnu dot org  2008-02-24 16:41 
---
Subject: Bug 33738

Author: dnovillo
Date: Sun Feb 24 16:40:32 2008
New Revision: 132591

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=132591
Log:

http://gcc.gnu.org/ml/gcc-patches/2008-02/msg01094.html

PR 33738
* tree-vrp.c (vrp_evaluate_conditional): With
-Wtype-limits, emit a warning when comparing against a
constant outside the natural range of OP0's type.
* c.opt (Wtype-limits): Move ...
* common.opt (Wtype-limits): ... here.

testsuite/ChangeLog

PR 33738
* g++.dg/warn/pr33738.C: New.

Added:
trunk/gcc/testsuite/g++.dg/warn/pr33738.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c.opt
trunk/gcc/common.opt
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c


-- 


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



[Bug c++/33738] -Wtype-limits misses a warning when comparing enums

2008-02-05 Thread dnovillo at gcc dot gnu dot org


--- Comment #7 from dnovillo at gcc dot gnu dot org  2008-02-05 16:32 
---
Subject: Bug 33738

Author: dnovillo
Date: Tue Feb  5 16:31:20 2008
New Revision: 132124

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=132124
Log:

http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00140.html

PR 33738
* tree-vrp.c (vrp_evaluate_conditional): Revert fix for
PR 33738.

testsuite/ChangeLog

PR 33738
* g++.dg/warn/pr33738.C: Remove.



Removed:
trunk/gcc/testsuite/g++.dg/warn/pr33738.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c


-- 


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



[Bug fortran/35093] [4.3 Regression] gfortran.dg/data_constraints_1.f90

2008-02-05 Thread dnovillo at gcc dot gnu dot org


--- Comment #2 from dnovillo at gcc dot gnu dot org  2008-02-05 16:58 
---

Why was I CC'd on this PR?


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|dnovillo at google dot com  |


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



[Bug c++/33738] -Wtype-limits misses a warning when comparing enums

2008-02-04 Thread dnovillo at gcc dot gnu dot org


--- Comment #3 from dnovillo at gcc dot gnu dot org  2008-02-05 04:18 
---
Subject: Bug 33738

Author: dnovillo
Date: Tue Feb  5 04:17:58 2008
New Revision: 132111

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=132111
Log:

http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00110.html

PR 33738
* tree-vrp.c (vrp_evaluate_conditional): With
-Wtype-limits, emit a warning when comparing against a
constant outside the natural range of OP0's type.

testsuite/ChangeLog

PR 33738
* testsuite/g++.dg/warn/pr33738.C: New.


Added:
trunk/gcc/testsuite/g++.dg/warn/pr33738.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c


-- 


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



[Bug c++/33738] -Wtype-limits misses a warning when comparing enums

2008-02-04 Thread dnovillo at gcc dot gnu dot org


--- Comment #4 from dnovillo at gcc dot gnu dot org  2008-02-05 04:29 
---

Fixed.  http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00110.html.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug middle-end/34743] New: Testcase gcc.dg/tree-ssa/20070302-1.c is broken

2008-01-11 Thread dnovillo at gcc dot gnu dot org
The test stopped testing what it's supposed to test.  The call to function
baz() should not be inlined.  This patch to the test exposes the failure.  The
operand scanner is adding non-clobbered symbols to the call site.

Details at http://gcc.gnu.org/ml/gcc-patches/2008-01/msg00477.html


-- 
   Summary: Testcase gcc.dg/tree-ssa/20070302-1.c is broken
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: middle-end
AssignedTo: dnovillo at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug tree-optimization/33237] [4.3 Regression] Tree memory partitioning is spending 430 seconds of a 490 second compile.

2008-01-08 Thread dnovillo at gcc dot gnu dot org


--- Comment #7 from dnovillo at gcc dot gnu dot org  2008-01-08 14:24 
---

Will work on this.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|WAITING |ASSIGNED
   Last reconfirmed|2008-01-08 13:35:38 |2008-01-08 14:24:05
   date||


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



[Bug tree-optimization/33870] [4.3 Regression] miscompiles sqlite

2007-11-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #23 from dnovillo at gcc dot gnu dot org  2007-11-13 15:20 
---
Subject: Bug 33870

Author: dnovillo
Date: Tue Nov 13 15:20:40 2007
New Revision: 130141

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=130141
Log:

pr 33870
* tree.h (strcut tree_memory_tag): add field unpartitionable.
remove field in_nested_struct.
(struct tree_struct_field_tag): add field nesting_level.
(sft_in_nested_struct): remove.
(sft_nesting_level): define.
(sft_unpartitionable_p): define.
* tree-ssa-alias.c (mem_sym_score): if mp-var is not
partitionable, return long_max.
(compute_memory_partitions): do not partition sfts marked
unpartitionable.
(create_sft): add argument nesting_level.  set
sft_nesting_level with it.  update all users.
(create_overlap_variables_for): show nesting level.
* tree-dfa.c (dump_subvars_for): likewise.
(dump_variable): likewise.
show whether the sft is partitionable or not.
* tree-flow.h (struct fieldoff): remove field
in_nested_struct.
add field nesting_level.
* tree-ssa-structalias.c (struct variable_info): remove
field in_nested_struct.
(push_fields_onto_fieldstack): add argument
nesting_level.  update all users.
update documentation.
update pair-nesting_level with nesting_level.
make recursive calls with nesting_level + 1.
(set_uids_in_ptset): if an sft is added to the points-to
set, mark it as unpartitionable.
* tree-ssa-operands.c (ref_nesting_level): new.
(add_vars_for_offset): call it.
add argument full_ref.  update
callers.
if var is inside a nested structure and the nesting level
of full_ref is lower than the nesting level of var,
adjust offset by the offset of var.

testsuite/ChangeLog

PR 33870
* gcc.c-torture/execute/pr33870-1.c: New test.
* gcc.dg/tree-ssa/alias-16.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr33870-1.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/alias-16.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-dfa.c
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-structalias.c
trunk/gcc/tree.h


-- 


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



[Bug tree-optimization/33870] [4.3 Regression] miscompiles sqlite

2007-11-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #24 from dnovillo at gcc dot gnu dot org  2007-11-13 15:47 
---

Fixed.  http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00719.html


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/33870] [4.3 Regression] miscompiles sqlite

2007-11-07 Thread dnovillo at gcc dot gnu dot org


--- Comment #21 from dnovillo at gcc dot gnu dot org  2007-11-08 00:26 
---

Fixed.  http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00374.html


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/33870] [4.3 Regression] miscompiles sqlite

2007-11-07 Thread dnovillo at gcc dot gnu dot org


--- Comment #20 from dnovillo at gcc dot gnu dot org  2007-11-08 00:01 
---
Subject: Bug 33870

Author: dnovillo
Date: Thu Nov  8 00:01:38 2007
New Revision: 129976

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=129976
Log:

PR 33870
* tree.h (struct tree_struct_field_tag): Add field in_nested_struct.
(SFT_IN_NESTED_STRUCT): Define.
* tree-dfa.c (dump_subvars_for): Show offset of each
sub-var.
* tree-flow.h (struct fieldoff): Add field in_nested_struct.
* tree-ssa-structalias.c (struct variable_info): Likewise.
(push_fields_onto_fieldstack): If OFFSET is positive,
set in_nested_struct.
(create_variable_info_for): Copy setting of
in_nested_struct from the field offset object.
(set_uids_in_ptset): Set SFT_IN_NESTED_STRUCT from the
variable info object.
* tree-ssa-operands.c (add_vars_for_offset): If VAR
belongs to a nested structure, adjust OFFSET by
SFT_OFFSET(VAR).

testsuite/ChangeLog

* gcc.c-torture/execute/pr33870.x: Remove.



Removed:
trunk/gcc/testsuite/gcc.c-torture/execute/pr33870.x
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-dfa.c
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-structalias.c
trunk/gcc/tree.h


-- 


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



[Bug tree-optimization/33870] [4.3 Regression] miscompiles sqlite

2007-11-02 Thread dnovillo at gcc dot gnu dot org


--- Comment #19 from dnovillo at gcc dot gnu dot org  2007-11-02 15:31 
---

Working on a fix.


-- 


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



[Bug c++/33738] New: -Wtype-limits misses a warning when comparing enums

2007-10-11 Thread dnovillo at gcc dot gnu dot org
This was found on GCC 4.2.1.  In this test case, VRP quietly folds a comparison
between an enum type and a constant value that the enum type can never take.
With -Wtype-limits, this should give the warning:

comparison always false due to limited range of data type

extern void link_error (void);

enum Alpha {
 ZERO = 0, ONE, TWO, THREE
};

Alpha a2;

int m1 = -1;
int GetM1() {
 return m1;
}

int main() {
 a2 = static_castAlpha(GetM1());
 if (a2 == -1) {   -- VRP should warn when folding this.
link_error ();
 }
 return 0;
}

This is not warned by the front end because we promote -1 to the same type as
a2.  But during VRP, we *do* fold the predicate, so warning when -Wtype-limits
is given in this case would be a good QOI feature.

I have a patch in the works to make VRP warn when it linearizes this predicate.


-- 
   Summary: -Wtype-limits misses a warning when comparing enums
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: dnovillo at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug tree-optimization/33593] tree-outof-ssa moves sources of non-call exceptions past sequence points

2007-09-30 Thread dnovillo at gcc dot gnu dot org


--- Comment #5 from dnovillo at gcc dot gnu dot org  2007-09-30 16:00 
---
Subject: Bug 33593

Author: dnovillo
Date: Sun Sep 30 16:00:36 2007
New Revision: 128893

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=128893
Log:

PR 33593
* tree-ssa-ter.c (is_replaceable_p): Return false if STMT may
throw an exception.


testsuite/ChangeLog

PR 33593
* g++.dg/tree-ssa/pr33593.C: New test.


Added:
trunk/gcc/testsuite/g++.dg/tree-ssa/pr33593.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-ter.c


-- 


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



[Bug tree-optimization/33099] New: Scalar evolutions confusing VRP with pointer values that wrap around

2007-08-17 Thread dnovillo at gcc dot gnu dot org
The following test case is miscompiled with GCC 4.2:

extern void abort (void);

volatile int N = 5;

void foo (void)
{
  int i;
  char *p, value[10];

  value[0] = 0x42;
  for (i = 0; i  N; i++)
if (i  0)
  {
p = (char *)i - 1;
*(value + (int) p) = (char) i;
  }

  if (value[0] != 1)
abort ();
}

main()
{
  foo ();
  return 0;
}

$ gcc --version
gcc (GCC) 4.2.2 20070816 (prerelease)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -O2 -o a a.c
$ ./a
Aborted (core dumped)

This was originally a C++ program which I converted into this C snippet from
GIMPLE.  I believe it's valid C, but I am not actually sure.  The original C++
code *is* valid, though.

The problem here starts in tree-vrp.c:adjust_range_with_scev() when we ask for
the scalar evolution of p_8 in the loop

L0:;
  i_24 = ASSERT_EXPR i_1, i_1  N.1_6;
  if (i_24  0) goto L1; else goto L7;
[ ... ]
L1:;
  i_4 = ASSERT_EXPR i_24, i_24  0;
  i.0_7 = (char *) i_4;
  p_8 = i.0_7 - 1B;

[...]

L2:;
  i_11 = i_24 + 1;
  # i_1 = PHI 0(2), i_11(5);
L3:;
  if (i_1  N.1_6) goto L0; else goto L4;

The call to analyze_scalar_evolution(loop, p_8) returns the chrec {-1B, +, 1B}
which is more or less understandable because the initial value i.0_7 can be
traced all the way back to the start of the loop to 0.

However:

1- SCEV has not realized that there is an ASSERT_EXPR in the path.  The initial
value of i.0_7 is actually 1, not 0.

2- When VRP sees the chrec {-1B, +, 1B} it asks whether it may wrap.  Since we
assumes that pointers never wrap, scev_probably_wraps_p returns false.  Which
is understandable, I guess, but in this case we get burnt by the logic that
follows in adjust_range_with_scev:

  * Since the range we have is VARYING, we take the initial value of the given
chrec and set it as the min value for the range.  So, the minimum value for the
new range is set to -1B.

  * Since the scalar evolution goes forward, we set the maximum value to the
max value for the type (upper_bound_in_type).  Which also happens to be -1B.

  * So, we end up with the range [-1B, -1B] which we later propagate into the
pointer dereference, causing the failure.

This problem does not happen in mainline because of the PTR_PLUS_EXPR cleanup.
Pointer arithmetic uses unsigned types and all this is avoided.

I think that the core problem is that we are tripping over the fact that while
we don't consider pointers to wrap, the instantiation of the chrec is giving
wrapped-around pointer values.  This confuses VRP.

So far, I see the following options for fixing this:

1- Teach SCEV that subtracting pointer values from 0 yields an unkown
chrec.  Similarly, adding to upper_bound_in_type will yield an unkown
chrec.  What's the wording in the standard wrt pointer arithmetic?  Is
the following undefined, implementation defined, or valid?

char *p = 0;
--p;
*p = 'x';

2- Teach SCEV about ASSERT_EXPRs when instantiating chrecs.  Would
benefit both mainline and 4.2.  May hide other bugs that occur when
there are no assertions around. But that's unlikely.

3- Tell VRP to refuse to do anything with pointer chrecs that have a constant
initial value.  This may prove suboptimal in some cases where we could've
gotten a good range, but they should be few and far between.

4- In mainline, the representation of pointer arithmetic has been
cleaned up considerably with the PTR_PLUS_EXPR patches.  Bringing those
in to 4.2 is IMO out of the question because of the sheer invasiveness.
But if the problem was widespread enough maybe we could consider it.  I
don't think it is, though.


-- 
   Summary: Scalar evolutions confusing VRP with pointer values that
wrap around
   Product: gcc
   Version: 4.2.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug middle-end/22456] [4.1/4.2/4.3 regression] missing is used uninitialized warning

2007-08-16 Thread dnovillo at gcc dot gnu dot org


--- Comment #15 from dnovillo at gcc dot gnu dot org  2007-08-16 15:22 
---

If not an exact duplicate, it's strongly related to 18501.  The code pattern is
slightly different so it may be worth keeping around.  Adding a dependency on
18501.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

  BugsThisDependsOn||18501


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



[Bug tree-optimization/31521] / conversion to is not done when the divisor can be zero

2007-08-03 Thread dnovillo at gcc dot gnu dot org


--- Comment #5 from dnovillo at gcc dot gnu dot org  2007-08-03 13:12 
---

Fixed.  http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00174.html.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/31521] / conversion to is not done when the divisor can be zero

2007-08-03 Thread dnovillo at gcc dot gnu dot org


--- Comment #4 from dnovillo at gcc dot gnu dot org  2007-08-03 13:08 
---
Subject: Bug 31521

Author: dnovillo
Date: Fri Aug  3 13:08:29 2007
New Revision: 127180

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127180
Log:
2007-08-03  Andrew Pinski  [EMAIL PROTECTED]
Diego Novillo  [EMAIL PROTECTED]

PR 31521
* tree-vrp.c (simplify_div_or_mod_using_ranges): Also simplify
if the range includes 0.

2007-08-03  Diego Novillo  [EMAIL PROTECTED]

PR 31521
* gcc.dg/tree-ssa/pr31521.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr31521.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c


-- 


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



[Bug tree-optimization/32390] New: tree-ssa-math-opts.c performs too many IL scans

2007-06-18 Thread dnovillo at gcc dot gnu dot org
In tree-ssa-math-opts.c we already had a pass to cse sin and cos.  The new
reciprocal sqrt pass is mechanically similar to that one.  It does a linear
scan over the CFG applying these peephole transformations.  This new pass
should not be doing a separate IL scan to do its job.

Perhaps it would be a good idea to do a single scan that calls back to
all these transformations on every statement?  I realize that each pass
requires its own setup and may need to do things a bit differently, but
perhaps we can save ourselves multiple IL scans if we generalize it a bit.


-- 
   Summary: tree-ssa-math-opts.c performs too many IL scans
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug middle-end/32327] [4.2 Regression] Incorrect stack sharing causing removal of live code

2007-06-18 Thread dnovillo at gcc dot gnu dot org


--- Comment #25 from dnovillo at gcc dot gnu dot org  2007-06-18 12:30 
---

Fixed symptoms with http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01081.html. 
Real fix still being discussed.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||amacleod at redhat dot com


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



[Bug middle-end/32327] [4.2 Regression] Incorrect stack sharing causing removal of live code

2007-06-15 Thread dnovillo at gcc dot gnu dot org


--- Comment #23 from dnovillo at gcc dot gnu dot org  2007-06-15 13:27 
---

Working on this today.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-06-15 13:27:21
   date||


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



[Bug middle-end/32327] [4.2 Regression] Incorrect stack sharing causing removal of live code

2007-06-15 Thread dnovillo at gcc dot gnu dot org


--- Comment #24 from dnovillo at gcc dot gnu dot org  2007-06-15 22:10 
---
Subject: Bug 32327

Author: dnovillo
Date: Fri Jun 15 22:10:09 2007
New Revision: 125748

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=125748
Log:

PR 32327
* tree-ssa-operands.c (build_ssa_operands): Initially assume
that the statement does not take any addresses.


testsuite/ChangeLog

PR 32327
* g++.dg/tree-ssa/pr32327-1.C: New test.
* g++.dg/tree-ssa/pr32327.C: New test.


Added:
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/tree-ssa/pr32327-1.C
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/tree-ssa/pr32327.C
Modified:
branches/gcc-4_2-branch/gcc/ChangeLog
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
branches/gcc-4_2-branch/gcc/tree-ssa-operands.c


-- 


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



[Bug c/32327] New: Incorrect stack sharing causing removal of live code

2007-06-13 Thread dnovillo at gcc dot gnu dot org
Given the following code:

--
typedef unsigned int size_t;
typedef unsigned long long uint64;

extern C {
extern void *memcpy (void *__restrict __dest,
  __const void *__restrict __src, size_t __n) /*throw ()*/;
}

extern void foo (void* p);

inline uint64
ghtonll(uint64 x)
{
 // __r is allocated the same stack slot as dest below
 union { unsigned long long int __ll;
 unsigned long int __l[2]; } __w, __r;
 __w.__ll = x;
 __r.__l[0] = (
   {
 register unsigned int __v;
 __asm__ __volatile__ (bswap %0 : =r (__v) :
   0 ((unsigned int) (__w.__l[1])));
 __v; });

 __r.__l[1] = (
   {
 register unsigned int __v;
 __asm__ __volatile__ (bswap %0 : =r (__v) :
   0 ((unsigned int) (__w.__l[0])));
 __v; });

 return __r.__ll;
}

inline uint64
double_2_uint64 (const double *source)
{
 uint64 dest;  // allocated the same stack slot as __r above
 memcpy(dest, source, sizeof(dest));
 return dest;
}

inline void
KeyFromUint64(uint64 fp) {
 uint64 norder;
 norder = ghtonll (fp);
 foo((char*)(norder));
}

void
KeyFromDouble(double x) {
 uint64 n = double_2_uint64 (x);
 if (n = 42) {
   n += 1;
 }

 KeyFromUint64(n);
}
---

Here is what gcc -O2 -fdump-tree-all (version 4.2) in at the end of the tree
passes.
Please take note of the assignment to dest after that of norder.

;; Function void KeyFromDouble(double) (_Z13KeyFromDoubled)

void KeyFromDouble(double) (x)
{
 uint64 n.50;
 char * norder.2;
 uint64 norder;
 register unsigned int __v;
 register unsigned int __v;
 union ._0 __r;
 union ._0 __w;
 uint64 dest;
 uint64 n;

bb 2:
 n.50 = VIEW_CONVERT_EXPRuint64(x);
 if (n.50  41) goto L0; else goto L5;

L5:;
 n = n.50;
 goto bb 5 (L1);

L0:;
 n = n.50 + 1;

L1:;
 __w.__ll = n;
 __asm__ __volatile__(bswap %0:=r __v:0 __w.__l[1]);
 __r.__l[0] = __v;
 __asm__ __volatile__(bswap %0:=r __v:0 __w.__l[0]);
 __r.__l[1] = __v;
 norder = __r.__ll;
 norder.2 = (char *) norder;
 dest = n.50;
 foo (norder.2);
 return;

}

Here is part of the RTL expansion:

(insn 45 43 47 9 (set (mem/c/i:DI (plus:SI (reg/f:SI 54 virtual-stack-vars)
   (const_int -8 [0xfff8])) [3 norder+0 S8 A32])
   (reg/v:DI 64 [ __r ])) -1 (nil)
   (nil))

(insn 47 45 49 9 (parallel [
   (set (reg:SI 59 [ norder.2 ])
   (plus:SI (reg/f:SI 54 virtual-stack-vars)
   (const_int -8 [0xfff8])))
   (clobber (reg:CC 17 flags))
   ]) -1 (nil)
   (nil))

(insn 49 47 51 9 (set (mem/c/i:DI (plus:SI (reg/f:SI 54 virtual-stack-vars)
   (const_int -8 [0xfff8])) [3 dest+0 S8 A32])
   (reg/v:DI 58 [ n.50 ])) -1 (nil)
   (nil))

Both dest  norder are assigned the same memory location
(virtual-stack-vars - 8). So later lifeness analysis thinks that the
first assignment is dead and it removes it. norder contains results of
bswap but gcc cannot remove the asm statement. However, since the
output of the asms are dead so they both got eax as the output
register.


-- 
   Summary: Incorrect stack sharing causing removal of live code
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug tree-optimization/31090] Revision 121302 causes 30% performance regression

2007-04-11 Thread dnovillo at gcc dot gnu dot org


--- Comment #14 from dnovillo at gcc dot gnu dot org  2007-04-11 17:14 
---
Subject: Bug 31090

Author: dnovillo
Date: Wed Apr 11 17:14:06 2007
New Revision: 123719

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=123719
Log:

PR 30735
PR 31090
* doc/invoke.texi: Document --params max-aliased-vops and
avg-aliased-vops.
* tree-ssa-operands.h (get_mpt_for, dump_memory_partitions,
debug_memory_partitions): Move to tree-flow.h
* params.h (AVG_ALIASED_VOPS): Define.
* tree-ssa-alias.c (struct mp_info_def): Remove.  Update all
users.
(mp_info_t): Likewise.
(get_mem_sym_stats_for): New.
(set_memory_partition): Move from tree-flow-inline.h.
(mark_non_addressable): Only clear the set of symbols for the
partition if it exists.
(dump_memory_partitions): Move from tree-ssa-operands.c
(debug_memory_partitions): Likewise.
(need_to_partition_p): New.
(dump_mem_ref_stats): New.
(debug_mem_ref_stats): New.
(dump_mem_sym_stats): New.
(debug_mem_sym_stats): New.
(update_mem_sym_stats_from_stmt): New.
(compare_mp_info_entries): New.
(mp_info_cmp): Call it.
(sort_mp_info): Change argument to a list of mem_sym_stats_t
objects.
(get_mpt_for): Move from tree-ssa-operands.c.
(find_partition_for): New.
(create_partition_for): Remove.
(estimate_vop_reduction): New.
(update_reference_counts): New.
(build_mp_info): New.
(compute_memory_partitions): Refactor.
Document new heuristic.
Call build_mp_info, update_reference_counts,
find_partition_for and estimate_vop_reduction.
(compute_may_aliases): Populate virtual operands before
calling debugging dumps.
(delete_mem_sym_stats): New.
(delete_mem_ref_stats): New.
(init_mem_ref_stats): New.
(init_alias_info): Call it.
(maybe_create_global_var): Remove alias_info argument.
Get number of call sites and number of pure/const call sites
from gimple_mem_ref_stats().
(dump_alias_info): Call dump_memory_partitions first.
(dump_points_to_info_for): Show how many times a pointer has
been dereferenced.
* opts.c (decode_options): For -O2 set --param
max-aliased-vops to 500.
For -O3 set --param max-aliased-vops to 1000 and --param
avg-aliased-vops to 3.
* fortran/options.c (gfc_init_options): Remove assignment to
MAX_ALIASED_VOPS.
* tree-flow-inline.h (gimple_mem_ref_stats): New.
* tree-dfa.c (dump_variable): Dump memory reference
statistics.
Dump NO_ALIAS* settings.
(referenced_var_lookup): Tidy.
(mem_sym_stats): New.
* tree-ssa-copy.c (may_propagate_copy): Return true if DEST
and ORIG are different SSA names for a memory partition.
* tree-ssa.c (delete_tree_ssa): Call delete_mem_ref_stats.
* tree-flow.h (struct mem_sym_stats_d): Define.
(mem_sym_stats_t): Define.
(struct mem_ref_stats_d): Define.
(struct gimple_df): Add field mem_ref_stats.
(enum noalias_state): Define.
(struct var_ann_d): Add bitfield noalias_state.
(mem_sym_stats, delete_mem_ref_stats, dump_mem_ref_stats,
debug_mem_ref_stats, debug_memory_partitions,
debug_mem_sym_stats): Declare.
* tree-ssa-structalias.c (update_alias_info): Update call
sites, pure/const call sites and asm sites in structure
returned by gimple_mem_ref_stats.
Remove local variable IS_POTENTIAL_DEREF.
Increase NUM_DEREFS if the memory expression is a potential
dereference.
Call update_mem_sym_stats_from_stmt.
If the memory references memory, call
update_mem_sym_stats_from_stmt for all the direct memory
symbol references found.
(intra_create_variable_infos): Set noalias_state field for
pointer arguments according to the value of
flag_argument_noalias.
* tree-ssa-structalias.h (struct alias_info): Remove fields
num_calls_found and num_pure_const_calls_found.
(update_mem_sym_stats_from_stmt): Declare.
* params.def (PARAM_MAX_ALIASED_VOPS): Change description.
Set default value to 100.
(PARAM_AVG_ALIASED_VOPS): Define.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/doc/invoke.texi
trunk/gcc/fortran/options.c
trunk/gcc/opts.c
trunk/gcc/params.def
trunk/gcc/params.h
trunk/gcc/tree-dfa.c
trunk/gcc/tree-flow-inline.h
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-copy.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-operands.h
trunk/gcc/tree-ssa-structalias.c
trunk/gcc/tree-ssa-structalias.h
trunk/gcc/tree-ssa.c
trunk/gcc/tree-vrp.c


-- 


http://gcc.gnu.org

[Bug tree-optimization/30735] [4.3 Regression] 50% slow down due to mem-ssa merge

2007-04-11 Thread dnovillo at gcc dot gnu dot org


--- Comment #6 from dnovillo at gcc dot gnu dot org  2007-04-11 17:14 
---
Subject: Bug 30735

Author: dnovillo
Date: Wed Apr 11 17:14:06 2007
New Revision: 123719

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=123719
Log:

PR 30735
PR 31090
* doc/invoke.texi: Document --params max-aliased-vops and
avg-aliased-vops.
* tree-ssa-operands.h (get_mpt_for, dump_memory_partitions,
debug_memory_partitions): Move to tree-flow.h
* params.h (AVG_ALIASED_VOPS): Define.
* tree-ssa-alias.c (struct mp_info_def): Remove.  Update all
users.
(mp_info_t): Likewise.
(get_mem_sym_stats_for): New.
(set_memory_partition): Move from tree-flow-inline.h.
(mark_non_addressable): Only clear the set of symbols for the
partition if it exists.
(dump_memory_partitions): Move from tree-ssa-operands.c
(debug_memory_partitions): Likewise.
(need_to_partition_p): New.
(dump_mem_ref_stats): New.
(debug_mem_ref_stats): New.
(dump_mem_sym_stats): New.
(debug_mem_sym_stats): New.
(update_mem_sym_stats_from_stmt): New.
(compare_mp_info_entries): New.
(mp_info_cmp): Call it.
(sort_mp_info): Change argument to a list of mem_sym_stats_t
objects.
(get_mpt_for): Move from tree-ssa-operands.c.
(find_partition_for): New.
(create_partition_for): Remove.
(estimate_vop_reduction): New.
(update_reference_counts): New.
(build_mp_info): New.
(compute_memory_partitions): Refactor.
Document new heuristic.
Call build_mp_info, update_reference_counts,
find_partition_for and estimate_vop_reduction.
(compute_may_aliases): Populate virtual operands before
calling debugging dumps.
(delete_mem_sym_stats): New.
(delete_mem_ref_stats): New.
(init_mem_ref_stats): New.
(init_alias_info): Call it.
(maybe_create_global_var): Remove alias_info argument.
Get number of call sites and number of pure/const call sites
from gimple_mem_ref_stats().
(dump_alias_info): Call dump_memory_partitions first.
(dump_points_to_info_for): Show how many times a pointer has
been dereferenced.
* opts.c (decode_options): For -O2 set --param
max-aliased-vops to 500.
For -O3 set --param max-aliased-vops to 1000 and --param
avg-aliased-vops to 3.
* fortran/options.c (gfc_init_options): Remove assignment to
MAX_ALIASED_VOPS.
* tree-flow-inline.h (gimple_mem_ref_stats): New.
* tree-dfa.c (dump_variable): Dump memory reference
statistics.
Dump NO_ALIAS* settings.
(referenced_var_lookup): Tidy.
(mem_sym_stats): New.
* tree-ssa-copy.c (may_propagate_copy): Return true if DEST
and ORIG are different SSA names for a memory partition.
* tree-ssa.c (delete_tree_ssa): Call delete_mem_ref_stats.
* tree-flow.h (struct mem_sym_stats_d): Define.
(mem_sym_stats_t): Define.
(struct mem_ref_stats_d): Define.
(struct gimple_df): Add field mem_ref_stats.
(enum noalias_state): Define.
(struct var_ann_d): Add bitfield noalias_state.
(mem_sym_stats, delete_mem_ref_stats, dump_mem_ref_stats,
debug_mem_ref_stats, debug_memory_partitions,
debug_mem_sym_stats): Declare.
* tree-ssa-structalias.c (update_alias_info): Update call
sites, pure/const call sites and asm sites in structure
returned by gimple_mem_ref_stats.
Remove local variable IS_POTENTIAL_DEREF.
Increase NUM_DEREFS if the memory expression is a potential
dereference.
Call update_mem_sym_stats_from_stmt.
If the memory references memory, call
update_mem_sym_stats_from_stmt for all the direct memory
symbol references found.
(intra_create_variable_infos): Set noalias_state field for
pointer arguments according to the value of
flag_argument_noalias.
* tree-ssa-structalias.h (struct alias_info): Remove fields
num_calls_found and num_pure_const_calls_found.
(update_mem_sym_stats_from_stmt): Declare.
* params.def (PARAM_MAX_ALIASED_VOPS): Change description.
Set default value to 100.
(PARAM_AVG_ALIASED_VOPS): Define.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/doc/invoke.texi
trunk/gcc/fortran/options.c
trunk/gcc/opts.c
trunk/gcc/params.def
trunk/gcc/params.h
trunk/gcc/tree-dfa.c
trunk/gcc/tree-flow-inline.h
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-copy.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-operands.h
trunk/gcc/tree-ssa-structalias.c
trunk/gcc/tree-ssa-structalias.h
trunk/gcc/tree-ssa.c
trunk/gcc/tree-vrp.c


-- 


http://gcc.gnu.org

[Bug middle-end/31543] [4.3 Regression]: gcc.dg/dfp/convert-bfp-fold.c failed

2007-04-11 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2007-04-12 00:28 
---

Hmm, I may have triggered this one with the fix for 30735.  I had inadvertently
tested with checking disabled.  Will take a look.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|dnovillo at redhat dot com  |
 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-04-12 00:28:15
   date||


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



[Bug rtl-optimization/19780] Floating point computation far slower for -mfpmath=sse

2007-04-05 Thread dnovillo at gcc dot gnu dot org


--- Comment #14 from dnovillo at gcc dot gnu dot org  2007-04-05 12:49 
---
(In reply to comment #11)

 So, why does SSA pass have to interfere with computation dataflow? This
 interferece makes things worse and effectively takes away user's control on 
 the
 flow of data.
 

Huh?  How is it relevant whether PHIs are in different order?  Conceptually,
the ordering of PHI nodes in a basic block is completely irrelevant.  Some pass
is getting confused when it shouldn't.  Transformations should not depend on
how PHI nodes are emitted in a block as all PHI nodes are always evaluated in
parallel.


-- 


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



[Bug tree-optimization/29585] [4.2 Regression] tree check: expected ssa_name, have var_decl in is_old_name, at tree-into-ssa.c:558

2007-03-31 Thread dnovillo at gcc dot gnu dot org


--- Comment #14 from dnovillo at gcc dot gnu dot org  2007-03-31 19:22 
---
Subject: Bug 29585

Author: dnovillo
Date: Sat Mar 31 19:21:46 2007
New Revision: 123386

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=123386
Log:
2007-03-31  Diego Novillo  [EMAIL PROTECTED]
Mark Mitchell  [EMAIL PROTECTED]

PR 29585
* class.c (dfs_accumulate_vtbl_inits): Use build_address
to build the vtbl entry.

testsuite/ChangeLog

PR 29585
* g++.dg/tree-ssa/pr29585.C: New test.


Added:
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/tree-ssa/pr29585.C
Modified:
branches/gcc-4_2-branch/gcc/cp/ChangeLog
branches/gcc-4_2-branch/gcc/cp/class.c
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug tree-optimization/29585] [4.2 Regression] tree check: expected ssa_name, have var_decl in is_old_name, at tree-into-ssa.c:558

2007-03-31 Thread dnovillo at gcc dot gnu dot org


--- Comment #15 from dnovillo at gcc dot gnu dot org  2007-03-31 19:28 
---

Fixed.  http://gcc.gnu.org/ml/gcc-patches/2007-03/msg02059.html


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/29585] [4.2 Regression] tree check: expected ssa_name, have var_decl in is_old_name, at tree-into-ssa.c:558

2007-03-29 Thread dnovillo at gcc dot gnu dot org


--- Comment #13 from dnovillo at gcc dot gnu dot org  2007-03-29 19:55 
---

I can't reproduce this on mainline anymore.  It does fail on the 4.2 branch.


-- 


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



[Bug tree-optimization/29585] [4.2 Regression] tree check: expected ssa_name, have var_decl in is_old_name, at tree-into-ssa.c:558

2007-03-13 Thread dnovillo at gcc dot gnu dot org


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|dnovillo at redhat dot com  |
 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2006-10-25 05:09:36 |2007-03-13 16:16:05
   date||


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



[Bug tree-optimization/31090] Revision 121302 causes 30% performance regression

2007-03-09 Thread dnovillo at gcc dot gnu dot org


--- Comment #11 from dnovillo at gcc dot gnu dot org  2007-03-09 23:53 
---

I'm already handling this family of performance problems.  I need a few more
days to finish the WIP patch I have.  In the meantime, see if increasing
--param max-aliased-vops works around the problem.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

  BugsThisDependsOn||30735


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



[Bug tree-optimization/31037] [4.3 Regression] ICE: verify_ssa failed - definition in block 23 does not dominate use in block 32

2007-03-06 Thread dnovillo at gcc dot gnu dot org


--- Comment #7 from dnovillo at gcc dot gnu dot org  2007-03-06 12:55 
---

Might as well take this one too.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2007-03-04 20:56:47 |2007-03-06 12:55:29
   date||


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



[Bug tree-optimization/31036] [4.3 Regression] ACATS: verify_ssa failed for c41307d c85006d cd10002 cxaa018

2007-03-04 Thread dnovillo at gcc dot gnu dot org


--- Comment #6 from dnovillo at gcc dot gnu dot org  2007-03-04 18:37 
---

I've just reproduced these failures locally.  Two options:

1- The Ada FE is somehow tricking alias analysis into thinking that some
call-clobbered symbols are not call-clobbered.

2- Alias analysis is not properly marking some call-clobbered symbols.

Tell me how I generate the .adb file from its .ada source?  What I see in
acats.log does not work.
gnatmake --GCC=/home/dnovillo/gcc/native.clean/bld/gcc/xgcc
-B/home/dnovillo/gcc/native.clean/bld/gcc/ -gnatws -O2
-I/home/dnovillo/gcc/native.clean/bld/gcc/testsuite/ada/acats/support
c41307d.adb -largs --GCC=/home/dnovillo/gcc/native.clean/bld/gcc/xgcc
-B/home/dnovillo/gcc/native.clean/bld/gcc/
/home/dnovillo/gcc/native.clean/bld/gcc/xgcc -c
-B/home/dnovillo/gcc/native.clean/bld/gcc/ -gnatws -O2
-I/home/dnovillo/gcc/native.clean/bld/gcc/testsuite/ada/acats/support
c41307d.adb


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-03-04 18:37:21
   date||


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



[Bug tree-optimization/31036] [4.3 Regression] ACATS: verify_ssa failed for c41307d c85006d cd10002 cxaa018

2007-03-04 Thread dnovillo at gcc dot gnu dot org


--- Comment #8 from dnovillo at gcc dot gnu dot org  2007-03-04 19:04 
---
(In reply to comment #7)
 If you have a run directory:
 cd gcc/testsuite/ada/acats/tests/c4/c41307d
 gdb  .../gcc/x86_64-unknown-linux-gnu/4.3.0/gnat1
 r -I../../../support -quiet -dumpbase c41307d.adb -O1 -mtune=generic
 c41307d.adb
 
 If not cd somewhere then
 gnatchop .../version-head/gcc/testsuite/ada/acats/tests/c4/c41307d.ada 
 gnatchop ../version-head/gcc/testsuite/ada/acats/support/rep*
 gcc -c -O1 c41307d.adb
 


Thanks.  It's one of these three symbols:

c41307d: This symbols is not marked call-clobbered: C.83
c41307d: This symbols is not marked call-clobbered: C.84
c41307d: This symbols is not marked call-clobbered: C.87

These symbols are in the alias set of a call-clobbered memory tag.  When the
operand scanner is adding VDEFs for this call-clobbered tag, it goes through
the set of aliases adding VDEF operands for them.  However, since these symbols
are not marked as call-clobbered, the operand scanner is ignoring them.

For now, I'm suspecting a bug in alias analysis because according to the alias
dumps, the variables are all considered global and addressable.  We are not
discovering that their address escape.


-- 


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



[Bug middle-end/30768] [4.3 regression]: ICE in ext/pb_ds/regression/list_update_data_map_rand.cc

2007-02-16 Thread dnovillo at gcc dot gnu dot org


--- Comment #23 from dnovillo at gcc dot gnu dot org  2007-02-16 12:35 
---
(In reply to comment #22)
 Frankly, I think it would make sense to remove completely this XFAIL-ing mess
 and just wait for Diego to fix the compiler issue.
 
Agreed. I don't understand why the rush to XFAIL a test that's obviously
exposing a bug. At most, I would like to understand which patch started
triggering the failure. It can't have been too long ago, the 2-3 day old
mainline tree I have in my box does not have this failure.


-- 


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



[Bug middle-end/30768] [4.3 regression]: ICE in ext/pb_ds/regression/list_update_data_map_rand.cc

2007-02-14 Thread dnovillo at gcc dot gnu dot org


--- Comment #11 from dnovillo at gcc dot gnu dot org  2007-02-14 23:54 
---
(In reply to comment #10)

 Diego, is this something that you might be able to help with?
 
Sure.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|dnovillo at redhat dot com  |
 AssignedTo|mark at codesourcery dot com|dnovillo at gcc dot gnu dot
   ||org


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



[Bug tree-optimization/30791] New: Need to run may-alias early in IPA

2007-02-13 Thread dnovillo at gcc dot gnu dot org
Without aliasing information some passes and cleanups cannot be scheduled
early.  See http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01176.html


-- 
   Summary: Need to run may-alias early in IPA
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: dnovillo at gcc dot gnu dot org
ReportedBy: dnovillo at gcc dot gnu dot org


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



[Bug tree-optimization/30735] 50% slow down due to mem-ssa merge

2007-02-12 Thread dnovillo at gcc dot gnu dot org


--- Comment #4 from dnovillo at gcc dot gnu dot org  2007-02-13 00:59 
---

I have now reproduced this locally and I'm working on a fix.


-- 


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



[Bug tree-optimization/30562] [4.3 Regression] remove unused variable is removing a referenced variable (in STORED_SYMS or LOADED_SYMS)

2007-02-08 Thread dnovillo at gcc dot gnu dot org


--- Comment #6 from dnovillo at gcc dot gnu dot org  2007-02-08 16:56 
---
Subject: Bug 30562

Author: dnovillo
Date: Thu Feb  8 16:55:43 2007
New Revision: 121715

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=121715
Log:

PR 30562
* tree-flow.h (struct var_ann_d): Remove field 'is_used'.
Update all users.
* tree-ssa-alias.c (compute_is_aliased): Remove.  Update all
users.
(init_alias_info):
* tree-ssa-live.c (remove_unused_locals): Do not remove
TREE_ADDRESSABLE variables.
* tree-ssa-structalias.c (compute_points_to_sets): Tidy.
* tree-ssa-operands.c (add_virtual_operand): Remove argument
FOR_CLOBBER.  Update all users.
If VAR has an associated alias set, add a virtual operand for
it if no alias is found to conflict with the memory reference.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-dfa.c
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-live.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-structalias.c
trunk/gcc/tree-ssa.c


-- 


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



[Bug tree-optimization/30562] [4.3 Regression] remove unused variable is removing a referenced variable (in STORED_SYMS or LOADED_SYMS)

2007-02-08 Thread dnovillo at gcc dot gnu dot org


--- Comment #7 from dnovillo at gcc dot gnu dot org  2007-02-08 17:10 
---

Fix http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00727.html


-- 


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



[Bug tree-optimization/30735] 50% slow down due to mem-ssa merge

2007-02-08 Thread dnovillo at gcc dot gnu dot org


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-02-08 18:42:31
   date||


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



[Bug tree-optimization/30562] [4.3 Regression] remove unused variable is removing a referenced variable (in STORED_SYMS or LOADED_SYMS)

2007-02-07 Thread dnovillo at gcc dot gnu dot org


--- Comment #5 from dnovillo at gcc dot gnu dot org  2007-02-07 23:33 
---

I cannot reproduce this bug with mainline as of 2007-02-06.  The bug is still
latent though, so I will commit a variant of this patch to fix it. 
Essentially, we should leave every TREE_ADDRESSABLE variable alone so that it
can be removed by a subsequent may_alias pass:

Index: tree-ssa-live.c
===
--- tree-ssa-live.c (revision 121699)
+++ tree-ssa-live.c (working copy)
@@ -502,18 +502,20 @@
   cell = TREE_CHAIN (*cell);
 }

-  /* Remove unused variables from REFERENCED_VARs.  As an special exception
- keep the variables that are believed to be aliased.  Those can't be
- easily removed from the alias sets and and operand caches.
- They will be removed shortly after next may_alias pass is performed.  */
+  /* Remove unused variables from REFERENCED_VARs.  As a special
+ exception keep the variables that are believed to be aliased.
+ Those can't be easily removed from the alias sets and operand
+ caches.  They will be removed shortly after the next may_alias
+ pass is performed.  */
   FOR_EACH_REFERENCED_VAR (t, rvi)
 if (!is_global_var (t)
 !MTAG_P (t)
 TREE_CODE (t) != PARM_DECL
 TREE_CODE (t) != RESULT_DECL
 !(ann = var_ann (t))-used
-!ann-is_aliased  !is_call_clobbered (t)  !ann-symbol_mem_tag)
-remove_referenced_var (t);
+!ann-symbol_mem_tag
+!TREE_ADDRESSABLE (t))
+  remove_referenced_var (t);
 }


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||WORKSFORME


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



[Bug tree-optimization/30562] [4.3 Regression] remove unused variable is removing a referenced variable (in STORED_SYMS or LOADED_SYMS)

2007-02-05 Thread dnovillo at gcc dot gnu dot org


--- Comment #4 from dnovillo at gcc dot gnu dot org  2007-02-05 19:48 
---

Testing alternate patch.


-- 


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



[Bug tree-optimization/30375] [4.3 Regression] tree-ssa-dse incorrectly removes struct initialization

2007-02-03 Thread dnovillo at gcc dot gnu dot org


--- Comment #8 from dnovillo at gcc dot gnu dot org  2007-02-03 15:49 
---
(In reply to comment #7)
 Is this now being looked into by Diego or Aldy?
 
It wasn't.  It is now.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2007-02-03 15:28:16 |2007-02-03 15:49:29
   date||


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



[Bug c/30256] -Wall

2006-12-19 Thread dnovillo at gcc dot gnu dot org


--- Comment #1 from dnovillo at gcc dot gnu dot org  2006-12-19 13:49 
---

This is not a valid bug report.  You have failed to include even the bare
minimal information needed.  Read http://gcc.gnu.org/bugs.html.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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



[Bug tree-optimization/30194] [4.3 Regression] gcc.dg/pr19633-1.c fails on the mainline

2006-12-14 Thread dnovillo at gcc dot gnu dot org


--- Comment #11 from dnovillo at gcc dot gnu dot org  2006-12-14 19:29 
---
(In reply to comment #10)
 (In reply to comment #9)
  (In reply to comment #8)
   There must be.  mem-ssa is @119760.  If you can reproduce with @119760, 
   then
   let me know and I'll take a look.
  
  I can reproduce it at @119761 which is the same revision for the trunk as
  119761 was a revision on a branch.
  
 OK, I'll take a look.  FX mind sending me that data about the test?  I can't
 reproduce it locally.
 
Oh, boy.  Now I see it.  We are making different partitioning decisions because
the order of the symbols in the partitioned alias set changed.  So, sometimes
we get one SFT into a partition which just happens to cross a call-site, and if
it's added to the partition, we miss the optimization.  In this case, the SFT
associated with b.s.w is added to MPT.69.

  L1:;
# MPT.69_8 = VDEF MPT.69_7(D) { MPT.69 }
b.s.w = 3;
# VUSE SFT.54_9(D), SFT.55_10(D), SFT.56_11(D) { SFT.54 SFT.55 SFT.56
SFT.62 }
# SFT.62_13 = VDEF SFT.62_12(D)
# MPT.69_14 = VDEF MPT.69_8 { SFT.62 MPT.69 }
x = bar1 (*c_1, *c_1);
# VUSE MPT.69_14 { MPT.69 }
D.1993_6 = b.s.w;


But if aliases are stored in different order in the alias set (different
DECL_UID assignment), we just happen not to choose this SFT for partitioning,
leaving the IL as:

 L1:;
# SFT.61_8 = VDEF SFT.61_7(D) { SFT.61 }
b.s.w = 3;
# VUSE SFT.58_9(D), SFT.59_10(D), SFT.60_11(D), SFT.61_8 { SFT.58 SFT.59
SFT.60 SFT.61 }
# MPT.69_13 = VDEF MPT.69_12(D) { MPT.69 }
x = bar1 (*c_1, *c_1);
# VUSE SFT.61_8 { SFT.61 }
D.1990_6 = b.s.w;

I will workaround this by increasing partitioning thresholds on this test, for
now, but I will leave the PR assigned to me while I figure out better
partitioning heuristics.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2006-12-14 19:29:22
   date||


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



[Bug tree-optimization/30194] [4.3 Regression] gcc.dg/pr19633-1.c fails on the mainline

2006-12-14 Thread dnovillo at gcc dot gnu dot org


--- Comment #12 from dnovillo at gcc dot gnu dot org  2006-12-14 19:50 
---
Subject: Bug 30194

Author: dnovillo
Date: Thu Dec 14 19:50:11 2006
New Revision: 119867

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=119867
Log:

PR 30194
* gcc.dg/pr19633-1.c: Increase threshold for partitioning
temporarily.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr19633-1.c


-- 


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



[Bug tree-optimization/30194] [4.3 Regression] gcc.dg/pr19633-1.c fails on the mainline

2006-12-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #3 from dnovillo at gcc dot gnu dot org  2006-12-13 14:11 
---

Works for me with @119760 (mem-ssa) on all arches (x86, x86_64, ia64 and
ppc64).

$ make check-gcc RUNTESTFLAGS=dg.exp=pr19633-1.c
[...]
Test Run By dnovillo on Wed Dec 13 09:05:53 2006
Native configuration is x86_64-unknown-linux-gnu

=== gcc tests ===

Schedule of variations:
unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /home/dnovillo/gcc/src/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /home/dnovillo/gcc/src/gcc/testsuite/gcc.dg/dg.exp ...

=== gcc Summary ===

# of expected passes2
/home/notnfs/dnovillo/BLD-gcc-native/gcc/xgcc  version 4.3.0 20061212
(experimental)


-- 


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



[Bug tree-optimization/30194] [4.3 Regression] gcc.dg/pr19633-1.c fails on the mainline

2006-12-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #5 from dnovillo at gcc dot gnu dot org  2006-12-13 16:50 
---
(In reply to comment #4)
 Subject: Re:  [4.3 Regression]
 gcc.dg/pr19633-1.c fails on the mainline
 
 On Wed, 2006-12-13 at 14:12 +, dnovillo at gcc dot gnu dot org
 wrote:
  Works for me with @119760 (mem-ssa) on all arches (x86, x86_64, ia64
  and
  ppc64). 
 
 So, this is about the mainline and not about the mem-ssa branch.  I
 don't see why you are looking at the mem-ssa branch's results except to
 say something changed on the mainline to expose this issue.
 
You completely misunderstood.  It works for me on my *mainline* tree that has
the mem-ssa patch applied.


-- 


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



[Bug tree-optimization/30089] Compiling FreeFem3d uses unreasonable amount of time and memory

2006-12-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #8 from dnovillo at gcc dot gnu dot org  2006-12-13 17:32 
---
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00959.html fixes the ICE in the
operand scanner.

The alias times should be back to saner values, but the memory consumption
problem is still there.  Still looking into that.


-- 

dnovillo at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|dnovillo at redhat dot com  |dnovillo at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2006-12-13 17:32:28
   date||


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



[Bug tree-optimization/30194] [4.3 Regression] gcc.dg/pr19633-1.c fails on the mainline

2006-12-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #7 from dnovillo at gcc dot gnu dot org  2006-12-13 17:41 
---
(In reply to comment #6)
 (In reply to comment #5)
  You completely misunderstood.  It works for me on my *mainline* tree that 
  has
  the mem-ssa patch applied.
 Then why does it fail for FX right after your patch?
 
I would love to find out.  FX, do you have a pre-processed .i?  Do you still
have a cc1 that eliminates the call to link_error?  What transformation removes
it?

Does it work with revision 119760?  That's the revision that added the main
mem-ssa changes (aliasing and rewriting).


-- 


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



[Bug tree-optimization/30194] [4.3 Regression] gcc.dg/pr19633-1.c fails on the mainline

2006-12-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #8 from dnovillo at gcc dot gnu dot org  2006-12-13 17:49 
---
(In reply to comment #2)
 Looks like the mem-ssa patches cause this.
 There are no other patches in that time frame.
 
There must be.  mem-ssa is @119760.  If you can reproduce with @119760, then
let me know and I'll take a look.


-- 


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



[Bug tree-optimization/30194] [4.3 Regression] gcc.dg/pr19633-1.c fails on the mainline

2006-12-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #10 from dnovillo at gcc dot gnu dot org  2006-12-13 22:37 
---
(In reply to comment #9)
 (In reply to comment #8)
  There must be.  mem-ssa is @119760.  If you can reproduce with @119760, then
  let me know and I'll take a look.
 
 I can reproduce it at @119761 which is the same revision for the trunk as
 119761 was a revision on a branch.
 
OK, I'll take a look.  FX mind sending me that data about the test?  I can't
reproduce it locally.


-- 


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



[Bug tree-optimization/30089] Compiling FreeFem3d uses unreasonable amount of time and memory

2006-12-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #9 from dnovillo at gcc dot gnu dot org  2006-12-13 23:50 
---

The memory problem is quite simple: We just have a *lot* of pointers and a
*lot* of addressable symbols.  Here is a breakdown of what happens on the first
call to compute_may_aliases:

During the first call to compute_may_aliases:

1- Size of cc1plus is 339Mb
2- Call to compute_points_to_sets grows to 355Mb (+4.72%)
3- Call to compute_flow_insensitive_aliasing grows to 364Mb (+2.54%)
4- Call to compute_flow_sensitive_aliasing grows to 667Mb (+83.2%)

The reason for this tremendous growth is quite simple.  There are 39,010 SSA
name pointers and many of them have their own points-to set, which we store in
that name's may-alias set.  We grow to 667Mb in the last loop of
compute_flow_sensitive_aliasing.

One thing we could do is just not use flow-sensitive information in these
cases.  If we don't set SSA_NAME_PTR_INFO, everything will default to
flow-insensitive information and things will Just Work.

Perhaps using sparse bitmaps for the may-alias sets might help with memory
consumption, but I found these bitmaps to slow down the operand scanner quite a
bit in the past.  May be worth a try.

Danny, thoughts?


-- 


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



[Bug tree-optimization/30089] Compiling FreeFem3d uses unreasonable amount of time and memory

2006-12-13 Thread dnovillo at gcc dot gnu dot org


--- Comment #10 from dnovillo at gcc dot gnu dot org  2006-12-13 23:54 
---
(In reply to comment #9)
 The memory problem is quite simple: We just have a *lot* of pointers and a
 *lot* of addressable symbols.  Here is a breakdown of what happens on the 
 first
 call to compute_may_aliases:
 
 During the first call to compute_may_aliases:
 
This is in the function ffparse, BTW.  Which has alias sets with 4.2 million
elements.


-- 


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



  1   2   3   4   >