[Bug regression/46931] Subversion id 167184 breaks building perlbench on power7 with debug

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46931

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  2010-12-14 
08:04:54 UTC ---
I think the actual problem was introduced in PR46172 commit, with the addition
of remove_dead_stmts_from_loop, as we now DCE what we have created during the
vectorization.
This function gsi_removes a stmt and then calls release_defs, which does
nothing though, because the SSA_NAME is name_registered_for_update_p, so the
release of it is deferred.  But when delete_update_ssa attempts to release the
SSANAME afterwards, the bb for the stmt is already NULL and so gsi_for_stmt
fails.

Not sure if there is something wrong on the remove_dead_stmts_from_loop side,
or if just releasing what has been created in the same pass has never been done
before and we should make insert_debug_temp_for_var_def do nothing if
gsi is NULL and def_stmt has NULL gimple_bb and the RHS isn't a constant.


[Bug rtl-optimization/46920] suboptimal register allocation with local register variables

2010-12-14 Thread bonzini at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46920

--- Comment #2 from Paolo Bonzini  2010-12-14 08:21:33 
UTC ---
> To generate the proposed code, we should assign r12 to p63.  IRA marks p63
> conflicting with r12 because DF-infrastructure reports r12 having intersected
> live ranges with p63.
>
> It is possible to solve the problem if we have conflicts based on values (not
> live ranges).  I'd not recommend to do that, because it will slow down RA
> without visible improvement on majority benchmarks (I did such experiment 
> about
> 7 years ago and reported about the results on GCC summit in 2004).

One alternative is to rematerialize values that have been copied to a
hard register before their uses (by inserting an r12:DI=r63:DI before
the use of r63).  This breaks the live ranges of the pseudos and
facilitates coalescing.

> By the way, usage of implicit hard registers in RTL (when it can be avoided.
> Example when hard registers can be avoided is their usage as call arguments) 
> is
> very bad idea for RA.  I see it a lot such code in x86-64 code.  I'd recommend
> to prevent optimizations before RA to abuse hard register usage.

As I said, the improvement from hard register variable here is 25% on
x86-64 and probably more (I can collect data) on i386.  This testcase
is distilled from a bytecode interpreter.


[Bug target/45084] configure: error: no 8-bit type

2010-12-14 Thread norak.van at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45084

--- Comment #14 from norak.van at gmail dot com 2010-12-14 08:27:39 UTC ---

OK

Anyway, could you please help me with this installation problem?

I check that there isn´t these directories:

/cygwin/usr/local/powerpc-ibm-eabi/include or
/cygwin/usr/local/powerpc-ibm-eabi/sys-include

but stdio.h library and all others libraries are in directories

/cygwin/usr/include
/cygwin/usr/include/sys

Is there any way to link to that directory.
Or Must I create /cygwin/usr/local/powerpc-ibm-eabi/include with
/cygwin/usr/include files and directories?

Pd. I follow steps in attach file.


[Bug target/45084] configure: error: no 8-bit type

2010-12-14 Thread norak.van at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45084

--- Comment #15 from norak.van at gmail dot com 2010-12-14 08:32:25 UTC ---
Created attachment 22750
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22750
building a GNU toolset


[Bug fortran/46849] [OOP] MODULE PROCEDURE resolution does not work in BLOCK or SELECT TYPE

2010-12-14 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46849

--- Comment #5 from Tobias Burnus  2010-12-14 
08:36:07 UTC ---
(In reply to comment #4)
> @@ -2717,7 +2717,7 @@ gfc_get_sym_tree (const char *name, gfc_namespace
>if (ns == NULL)
> -ns = gfc_current_ns;
> +ns = gfc_find_proc_namespace (gfc_current_ns);

That looks wrong. gfc_get_sym_tree is called several times in decl.c, match.c,
parse.c and primary.c with NULL - I fear that this patch will cause symbols end
up in the wrong name space.

I think one should rather do something like the following - though one might
need to be a bit more careful and restrict it, e.g., to procedures.

--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -11784,7 +11784,7 @@ resolve_symbol (gfc_symbol *sym)
   for (ns = gfc_current_ns->parent; ns; ns = ns->parent)
{
  symtree = gfc_find_symtree (ns->sym_root, sym->name);
- if (symtree && symtree->n.sym->generic)
+ if (symtree) /* && symtree->n.sym->generic)*/
{
  this_symtree = gfc_find_symtree (gfc_current_ns->sym_root,
   sym->name);


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #12 from Dominique d'Humieres  
2010-12-14 08:54:08 UTC ---
I have regstrapped the patch in comment #7 on top of revision 167770. The
failures corresponding to this PR are gone. However I see the following for
both -m32 and -m64:

FAIL: g++.dg/tree-prof/partition2.C compilation,  -g  -fprofile-use
UNRESOLVED: g++.dg/tree-prof/partition2.C execution,-g  -fprofile-use
FAIL: g++.dg/tree-prof/partition2.C compilation,  -O3 -g  -fprofile-use
UNRESOLVED: g++.dg/tree-prof/partition2.C execution,-O3 -g  -fprofile-use

the corresponding typical log entry being

Executing on host: /opt/gcc/build_w/gcc/testsuite/g++/../../g++
-B/opt/gcc/build_w/gcc/testsuite/g++/../../
/opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/partition2.C  -nostdinc++
-I/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/include/x86_64-apple-darwin10.5.0
-I/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/include
-I/opt/gcc/work/libstdc++-v3/libsupc++
-I/opt/gcc/work/libstdc++-v3/include/backward
-I/opt/gcc/work/libstdc++-v3/testsuite/util -fmessage-length=0  -g 
-fnon-call-exceptions -freorder-blocks-and-partition -fprofile-use   
-L/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs 
-B/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs 
-L/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs
-L/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libiberty  -multiply_defined
suppress -lm   -m32 -o /opt/gcc/build_w/gcc/testsuite/g++/partition2.x02   
(timeout = 300)
warning: no debug symbols in executable (-arch i386)^M
output is:
warning: no debug symbols in executable (-arch i386)^M

FAIL: g++.dg/tree-prof/partition2.C compilation,  -g  -fprofile-use
UNRESOLVED: g++.dg/tree-prof/partition2.C execution,-g  -fprofile-use

The key option is -g (the other tests of g++.dg/tree-prof/partition2.C without
-g succeed). I don't know if these failures come from the patch or have been
introduced between revisions 167731 and 167770 by an other commit.


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #13 from Iain Sandoe  2010-12-14 09:09:07 
UTC ---
(In reply to comment #12)
> I have regstrapped the patch in comment #7 on top of revision 167770. The
> failures corresponding to this PR are gone. However I see the following for
> both -m32 and -m64:
> 
> FAIL: g++.dg/tree-prof/partition2.C compilation,  -g  -fprofile-use
> UNRESOLVED: g++.dg/tree-prof/partition2.C execution,-g  -fprofile-use
> FAIL: g++.dg/tree-prof/partition2.C compilation,  -O3 -g  -fprofile-use
> UNRESOLVED: g++.dg/tree-prof/partition2.C execution,-O3 -g  -fprofile-use
> 
> the corresponding typical log entry being
> 
> Executing on host: /opt/gcc/build_w/gcc/testsuite/g++/../../g++
> -B/opt/gcc/build_w/gcc/testsuite/g++/../../
> /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/partition2.C  -nostdinc++
> -I/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/include/x86_64-apple-darwin10.5.0
> -I/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/include
> -I/opt/gcc/work/libstdc++-v3/libsupc++
> -I/opt/gcc/work/libstdc++-v3/include/backward
> -I/opt/gcc/work/libstdc++-v3/testsuite/util -fmessage-length=0  -g 
> -fnon-call-exceptions -freorder-blocks-and-partition -fprofile-use   
> -L/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs 
> -B/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs 
> -L/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libstdc++-v3/src/.libs
> -L/opt/gcc/build_w/x86_64-apple-darwin10.5.0/i386/libiberty  -multiply_defined
> suppress -lm   -m32 -o /opt/gcc/build_w/gcc/testsuite/g++/partition2.x02   
> (timeout = 300)
> warning: no debug symbols in executable (-arch i386)^M
> output is:
> warning: no debug symbols in executable (-arch i386)^M
> 
> FAIL: g++.dg/tree-prof/partition2.C compilation,  -g  -fprofile-use
> UNRESOLVED: g++.dg/tree-prof/partition2.C execution,-g  -fprofile-use
> 
> The key option is -g (the other tests of g++.dg/tree-prof/partition2.C without
> -g succeed). I don't know if these failures come from the patch or have been
> introduced between revisions 167731 and 167770 by an other commit.

I think this is a different problem - those messages are characteristic of
dsymutil missing an input file.
This might be related to the changes made to call dsymutil within collect2.

Is it possible to isolate the command and run it with -v ? and/or -Wl,-debug ?


[Bug tree-optimization/46693] incorrect code generation with -O2 optimization enabled

2010-12-14 Thread ramana at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46693

Ramana Radhakrishnan  changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
  Known to work||4.3.5, 4.4.6
  Known to fail||4.5.1

--- Comment #11 from Ramana Radhakrishnan  
2010-12-14 09:27:58 UTC ---
So the problem on trunk atleast seems to be in gimple-fold 

maybe_fold_or_comparisons and friends where all the comparisons are folded out
into a single boolean node of 1 where ideally the result of the basic block
should be reduced to the (c <= 31) && (x != 9) check . The other 2 equality
comparisons are superfluous. 

I won't be able to look at this for a couple of days - hence unassigning
myself.


The problem for this file goes away with -fno-tree-vrp but that's a heavy
weight work around.



cheers
Ramana


[Bug target/46934] gcc ICE: error: unrecognizable insn: in extract_insn, at recog.c:2109

2010-12-14 Thread ramana at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46934

Ramana Radhakrishnan  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2010.12.14 09:31:56
 CC||ramana at gcc dot gnu.org
   Target Milestone|--- |4.6.0
 Ever Confirmed|0   |1

--- Comment #1 from Ramana Radhakrishnan  2010-12-14 
09:31:56 UTC ---
Confirmed.


[Bug target/45701] [4.6 Regression] Fail to prefer using r3 for padding a push/pop multiple to 8-byte alignment

2010-12-14 Thread ramana at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45701

Ramana Radhakrishnan  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2010.12.14 09:34:41
 CC||ramana at gcc dot gnu.org
 Ever Confirmed|0   |1


[Bug tree-optimization/46693] incorrect code generation with -O2 optimization enabled

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46693

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #12 from Jakub Jelinek  2010-12-14 
10:06:52 UTC ---
Maybe dup of PR46909?


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

Jan Hubicka  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #14 from Jan Hubicka  2010-12-14 
10:08:25 UTC ---
Hi,
does the following patch help?
Index: opts.c
===
--- opts.c  (revision 167752)
+++ opts.c  (working copy)
@@ -738,6 +738,9 @@ finish_options (struct gcc_options *opts
   opts->x_flag_reorder_blocks = 1;
 }

+  if (opts->x_flag_reorder_blocks_and_partition)
+opts->x_flag_reorder_blocks = 1;
+
   /* If the target requested unwind info, then turn off the partitioning
  optimization with a different message.  Likewise, if the target does not
  support named sections.  */

it seems that with -freorder-functions-and-partition we should always imply
-freorder-functions. Without this the partitioning code will now partition in
between the same function section that is no-op and probably leads to failure.

This however also imply a semi-latent bug - if 
-freorder-functions-and-partition breaks on cases where both hot and cold
sections are the same, it ought to disable itself, because for some functions
(like ones in named sections) we can not partition then.


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #15 from Jan Hubicka  2010-12-14 
10:09:53 UTC ---
Also it is clear who starts the infinite recursion?  I find it odd, that
disabling the function partitioning lead to need to explicitely declare
unlikely section.  Is someone else trying to access it and fail for some
reason?


[Bug lto/46820] Undefined reference errors with LTO

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46820

--- Comment #10 from Jan Hubicka  2010-12-14 
10:27:03 UTC ---
__asm__(".weak\tfoo\n\t.set\tfoo,bar");
sets FOO as equivalent of BAR. I guess this breaks when asm ends up in
different partition than BAR and also leads to undefined symbols when LTO
symtab is used since that one does not define any of symbols defined in asm
statements.

I am affraid that there is currently no way to make such asm statement LTO
friendly and also that we are quite broken WRT symbols defined in the asm
statements (I guess I didn't see this with Mozilla since it is shared library).

Isn't there function attribute that does the same as your asm statement?


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #16 from Iain Sandoe  2010-12-14 10:39:10 
UTC ---
(In reply to comment #15)
> Also it is clear who starts the infinite recursion?  I find it odd, that
> disabling the function partitioning lead to need to explicitely declare
> unlikely section.  Is someone else trying to access it and fail for some
> reason?

well the pre-existing implementation of :

static section *
darwin_text_section (int reloc, int weak)
{
  if (reloc)
return (weak
? darwin_sections[text_unlikely_coal_section]
: unlikely_text_section ());  +
  else
return (weak
? darwin_sections[text_coal_section]
: text_section);
}

...  is invoked when darwin_function_section () returns NULL.


[Bug lto/46820] Undefined reference errors with LTO

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46820

--- Comment #11 from Jan Hubicka  2010-12-14 
10:46:48 UTC ---
... I meat weakref attribute.


[Bug middle-end/46935] New: We should recognize expanded switch statement and convert 2 way switch statements into shift & mask test

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46935

   Summary: We should recognize expanded switch statement and
convert 2 way switch statements into shift & mask test
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: hubi...@gcc.gnu.org


As observed at http://blog.regehr.org/archives/320 (example 7)
testcase:

int crud (unsigned char c)
{
  return (((int) c <= 32 || (int) c == 46) || (int) c == 44)
 || (int) c == 58) || (int) c == 59) || (int) c == 60)
  || (int) c == 62) || (int) c == 34) || (int) c == 92)
   || (int) c == 39) != 0);
}

Can be compiled using shift and mask test operation as:
crud:
movzbl%dil, %edi
cmpl  $32, %edi
jle   ..B1.4
addl  $-34, %edi
cmpl  $64, %edi
jae   ..B1.5
movl  $1, %eax
movl  %edi, %ecx
shlq  %cl, %rax
movq  $0x40017001421, %rdx
testq %rdx, %rax
je..B1.5
..B1.4:
movl  $1, %eax
ret
..B1.5:
xorl  %eax, %eax
ret

Probably switch conversion pass could be responsible for this.

Honza


[Bug middle-end/46935] We should recognize expanded switch statement and convert 2 way switch statements into shift & mask test

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46935

Jan Hubicka  changed:

   What|Removed |Added

 CC||mjambor at suse dot cz
   Severity|normal  |enhancement

--- Comment #1 from Jan Hubicka  2010-12-14 
10:51:51 UTC ---
Note that both llvm and ICC support this optimization and it was requested by
kernel folks for a while (they do so by hand)


Re: [Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread Jan Hubicka
> well the pre-existing implementation of :
> 
> static section *
> darwin_text_section (int reloc, int weak)
> {
>   if (reloc)
> return (weak
> ? darwin_sections[text_unlikely_coal_section]
> : unlikely_text_section ());  +
>   else
> return (weak
> ? darwin_sections[text_coal_section]
> : text_section);
> }
> 
> ...  is invoked when darwin_function_section () returns NULL.
The code probably should also disable itself with -fno-reorder-functions...

Honza


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #17 from Jan Hubicka  2010-12-14 10:58:40 
UTC ---
> well the pre-existing implementation of :
> 
> static section *
> darwin_text_section (int reloc, int weak)
> {
>   if (reloc)
> return (weak
> ? darwin_sections[text_unlikely_coal_section]
> : unlikely_text_section ());  +
>   else
> return (weak
> ? darwin_sections[text_coal_section]
> : text_section);
> }
> 
> ...  is invoked when darwin_function_section () returns NULL.
The code probably should also disable itself with -fno-reorder-functions...

Honza


[Bug middle-end/46935] We should recognize expanded switch statement and convert 2 way switch statements into shift & mask test

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46935

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  2010-12-14 
11:01:11 UTC ---
We probably don't want to do such transformation into GIMPLE_SWITCH always,
only if the number of comparisons of the same SSA_NAME is big enough and the
range isn't too big.

expand_switch_using_bit_tests_p can be used if we want to limit it just to the
bittest cases.


[Bug c++/46646] [trans-mem] __cxa_rethrow and __builtin_eh_pointer are unsafe

2010-12-14 Thread patrick.marlier at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46646

--- Comment #2 from Patrick Marlier  
2010-12-14 11:13:15 UTC ---
Created attachment 22751
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22751
testcase .ii

I will try to make a shorter one soon.


[Bug c/46902] [4.6 Regression] gcc.dg/plugin/plugindir*.c gives ICEs on powerpc-apple-darwin9

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46902

--- Comment #13 from Iain Sandoe  2010-12-14 11:55:39 
UTC ---
(In reply to comment #12)
> On Mon, 13 Dec 2010, iains at gcc dot gnu.org wrote:
> 
> > > > (gdb) print plugindir_string
> > > > $1 = 0x 
> > > > 
> > > > which is the origin of the current fail (there will be other issues 
> > > > related to
> > > > the FIXME, I'm sure).
> > > 
> > > independent of whether -iplugindir is given on the c/l.
> > 
> > in fact, the whole of global_options looks suspiciously un-initialized.
> 
> It's supposed to be runtime-initialized from global_options_init; see 
> init_options_struct.

[this analysis with the stage1 compiler, I will look again with the stage2
one].

:-( 
... we seem to have a miscomputation of the offset to
global_options.x_plugindir_string in the default_plugin_dir_name () function.

; basic block 5
; /GCC/gcc-live-trunk/gcc/plugin.c:883
LM330:
addis r2,r31,ha16(L_global_options$non_lazy_ptr-"L023$pb");
tmp129,,
lwz r2,lo16(L_global_options$non_lazy_ptr-"L023$pb")(r2);
tmp128,, tmp129
lwz r0,2044(r2); global_options.x_plugindir_string, D.22779

===
(gdb) print &global_options   
$14 = (struct gcc_options *) 0x4129d920
(gdb) print &global_options.x_plugindir_string
$15 = (const char **) 0x4129e108

(gdb) print/x 0x4129d920 + 2044 (0x7fc)
$17 = 0x4129e11c

===
rs6000.s:
addis r2,r31,ha16(L_global_options$non_lazy_ptr-"L008$pb");
tmp926,,
lwz r2,lo16(L_global_options$non_lazy_ptr-"L008$pb")(r2);
tmp925,, tmp926
lwz r0,2044(r2); global_options.x_TARGET_ALWAYS_HINT, D.70115
==
Have to think of how to pursue this further...


[Bug c++/46714] [trans-mem] aliased to undefined symbol with -O1

2010-12-14 Thread aldyh at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46714

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2010.12.14 12:05:40
 Ever Confirmed|0   |1

--- Comment #1 from Aldy Hernandez  2010-12-14 
12:05:40 UTC ---
Fixed and pending approval:
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01087.html


[Bug c++/45940] [trans-mem] Error of unsafe function even if annotated

2010-12-14 Thread aldyh at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45940

Aldy Hernandez  changed:

   What|Removed |Added

   Severity|normal  |enhancement


[Bug tree-optimization/46693] incorrect code generation with -O2 optimization enabled

2010-12-14 Thread ramana at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46693

--- Comment #13 from Ramana Radhakrishnan  
2010-12-14 12:07:54 UTC ---
(In reply to comment #12)
> Maybe dup of PR46909?

I can verify that the fix for PR46909 fixes the issue on trunk.

I'm looking into 4.5 branch right now.


cheers
Ramana


[Bug tree-optimization/46693] incorrect code generation with -O2 optimization enabled

2010-12-14 Thread ramana at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46693

--- Comment #14 from Ramana Radhakrishnan  
2010-12-14 12:13:00 UTC ---
It doesn't seem to fail for me with the RC for GCC 4.5.2

with -march=armv5te -mthumb
 -march=armv5te
 -march=armv7-a
 -march=armv7-a -mthumb

at -O2, -O3 and -Os


[Bug fortran/46849] [OOP] MODULE PROCEDURE resolution does not work in BLOCK or SELECT TYPE

2010-12-14 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46849

--- Comment #6 from janus at gcc dot gnu.org 2010-12-14 12:13:04 UTC ---
(In reply to comment #5)
> > @@ -2717,7 +2717,7 @@ gfc_get_sym_tree (const char *name, gfc_namespace
> >if (ns == NULL)
> > -ns = gfc_current_ns;
> > +ns = gfc_find_proc_namespace (gfc_current_ns);
> 
> That looks wrong. gfc_get_sym_tree is called several times in decl.c, match.c,
> parse.c and primary.c with NULL - I fear that this patch will cause symbols 
> end
> up in the wrong name space.

Yes, you're right. It produces a fair number of regressions ...


> I think one should rather do something like the following - though one might
> need to be a bit more careful and restrict it, e.g., to procedures.
> 
> --- a/gcc/fortran/resolve.c
> +++ b/gcc/fortran/resolve.c
> @@ -11784,7 +11784,7 @@ resolve_symbol (gfc_symbol *sym)
>for (ns = gfc_current_ns->parent; ns; ns = ns->parent)
> {
>   symtree = gfc_find_symtree (ns->sym_root, sym->name);
> - if (symtree && symtree->n.sym->generic)
> + if (symtree) /* && symtree->n.sym->generic)*/
> {
>   this_symtree = gfc_find_symtree (gfc_current_ns->sym_root,
>sym->name);


I agree that this is better, though it still causes some regressions. I will
now test the following variant:

Index: gcc/fortran/resolve.c
===
--- gcc/fortran/resolve.c   (revision 167790)
+++ gcc/fortran/resolve.c   (working copy)
@@ -11784,7 +11784,7 @@ resolve_symbol (gfc_symbol *sym)
   for (ns = gfc_current_ns->parent; ns; ns = ns->parent)
{
  symtree = gfc_find_symtree (ns->sym_root, sym->name);
- if (symtree && symtree->n.sym->generic)
+ if (symtree && symtree->n.sym->attr.flavor == FL_PROCEDURE)
{
  this_symtree = gfc_find_symtree (gfc_current_ns->sym_root,
   sym->name);


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #18 from Iain Sandoe  2010-12-14 12:17:00 
UTC ---
(In reply to comment #17)
> > well the pre-existing implementation of :
> > 
> > static section *
> > darwin_text_section (int reloc, int weak)
> > {
> >   if (reloc)
> > return (weak
> > ? darwin_sections[text_unlikely_coal_section]
> > : unlikely_text_section ());  +
> >   else
> > return (weak
> > ? darwin_sections[text_coal_section]
> > : text_section);
> > }
> > 
> > ...  is invoked when darwin_function_section () returns NULL.
> The code probably should also disable itself with -fno-reorder-functions...

well, this also fixes the issue .. 

but, the original implementation of darwin_text_section () pre-dates my
involvement 
-- I am not sure why it partitions, and ...
--  if we should preserve some partitioning even when the option is off ... 

Mike?

Index: gcc/opts.c
===
--- gcc/opts.c(revision 167793)
+++ gcc/opts.c(working copy)
@@ -723,6 +723,9 @@ finish_options (struct gcc_options *opts, struct g
   opts->x_flag_reorder_blocks = 1;
 }

+  if (opts->x_flag_reorder_blocks_and_partition)
+opts->x_flag_reorder_blocks = 1;
+
   /* If user requested unwind info, then turn off the partitioning
  optimization.  */

Index: gcc/config/darwin.c
===
--- gcc/config/darwin.c(revision 167793)
+++ gcc/config/darwin.c(working copy)
@@ -1147,7 +1147,7 @@ darwin_mark_decl_preserved (const char *name)
 static section *
 darwin_text_section (int reloc, int weak)
 {
-  if (reloc)
+  if (flag_reorder_functions && reloc)
 return (weak
 ? darwin_sections[text_unlikely_coal_section]
 : unlikely_text_section ());


[Bug rtl-optimization/46875] [4.6 Regression] ICE: verify_flow_info failed: too many outgoing branch edges from bb 3 with -Os -fselective-scheduling2

2010-12-14 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46875

--- Comment #3 from Alexander Monakov  2010-12-14 
12:43:50 UTC ---
Author: amonakov
Date: Tue Dec 14 12:43:47 2010
New Revision: 167794

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167794
Log:
PR rtl-optimization/46875
* sched-vis.c (print_pattern): Dump "sequence" for ADDR_VECs.
* sel-sched-ir.c (bb_has_removable_jump_to_p): Forbid table jumps.

testsuite:
* gcc.dg/pr46875.c: New.


Added:
trunk/gcc/testsuite/gcc.dg/pr46875.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/sched-vis.c
trunk/gcc/sel-sched-ir.c
trunk/gcc/testsuite/ChangeLog


[Bug rtl-optimization/46875] [4.6 Regression] ICE: verify_flow_info failed: too many outgoing branch edges from bb 3 with -Os -fselective-scheduling2

2010-12-14 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46875

Alexander Monakov  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #4 from Alexander Monakov  2010-12-14 
12:47:23 UTC ---
Fixed.


[Bug target/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770

Jan Hubicka  changed:

   What|Removed |Added

 CC||paolo.carlini at oracle dot
   ||com

--- Comment #58 from Jan Hubicka  2010-12-14 
12:52:06 UTC ---
Having everyone with knowledge of static construction alerted, can't we use the
GNU constructor priorities to solve PR44952? I.e. having highest priority
constructor to construct iostream in the module defining cout instead of having
static construction in every module?


[Bug c/46936] New: turn __attribute__ ((nonnull (x))) into assert in debug mode

2010-12-14 Thread e...@sf-mail.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46936

   Summary: turn __attribute__ ((nonnull (x))) into assert in
debug mode
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: e...@sf-mail.de


I have this simple function to free a linked list:

void freeips(struct ips *p)
{
while (p) {
struct ips *thisip = p;

p = thisip->next;
free(thisip);
}
}

I accidentially annotated this as __attribute__ ((nonnull (1))) and called it
with a NULL argument. This still worked as long as I was building with -g. Once
I build this in release mode it crashed (correctly). I would like to have some
sort of automatic assert once I annotate a function this way. So when I build
this function annotated and pass NULL I get a meaningful crash and I can debug
this. If I need to explicitely switch this on by a command line switch it's
fine for me.


[Bug fortran/46874] [OpenMP] ICE in gfc_conv_descriptor_data_get, at fortran/trans-array.c:147

2010-12-14 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46874

--- Comment #5 from Tobias Burnus  2010-12-14 
12:56:38 UTC ---
Patch: http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01081.html


[Bug c/46902] [4.6 Regression] gcc.dg/plugin/plugindir*.c gives ICEs on powerpc-apple-darwin9

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46902

--- Comment #14 from Iain Sandoe  2010-12-14 12:58:20 
UTC ---
the stage3 compiler is the same.

it appears that plugin.c thinks there are [5] more options than there are... 

at the moment, dunno if this is a code-gen or a config issue.

.. so it's picking up x_TARGET_ALWAYS_HINT instead of x_plugindir_string.

  x_plugindir_string = 0x0, 
  x_aix_struct_return = 0, 
  x_TARGET_ALIGN_BRANCH_TARGETS = -1, 
  x_TARGET_ALLOW_DF_PERMUTE = 0, 
  x_TARGET_ALLOW_MOVMISALIGN = -1, 
  x_TARGET_ALWAYS_HINT = -1,


[Bug middle-end/46667] [4.6 Regression] -freorder-blocks-and-partition -g failed and libstdc++ builds for arm-eabi are broken.

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46667

--- Comment #11 from Jan Hubicka  2010-12-14 
13:07:08 UTC ---
Author: hubicka
Date: Tue Dec 14 13:07:05 2010
New Revision: 167795

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167795
Log:
PR middle-end/46667
* varasm.c (assemble_start_function): Do not call resolve_unique_section.
* cfgexpand.c (gimple_expand_cfg): Resolve it here.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
trunk/gcc/varasm.c


[Bug middle-end/46667] [4.6 Regression] -freorder-blocks-and-partition -g failed and libstdc++ builds for arm-eabi are broken.

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46667

Jan Hubicka  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #12 from Jan Hubicka  2010-12-14 
13:08:51 UTC ---
Fixed.


[Bug c++/46714] [trans-mem] aliased to undefined symbol with -O1

2010-12-14 Thread aldyh at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46714

Aldy Hernandez  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution||FIXED


[Bug target/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them

2010-12-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770

--- Comment #59 from Paolo Carlini  2010-12-14 
13:17:13 UTC ---
Sure, if you want to play with that I have no principled objections. I only add
here that we probably have another related PR filed by Ian (is already in CC?)
and that, as far as I know, those priorities don't work everywhere (I know very
little about init priorities in general, sorry)


Re: [Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread Jan Hubicka
Hi,
does the following patch fix the problem?
darwin_text_section no longer needs to care about hot/cold code since this is
already done in darwin_function_section.

In fact you might additionally consider putting 
  return (DECL_WEAK (decl)
  ? darwin_sections[text_coal_section]
  : text_section);
into places returning NULL in darwin_function_section, removing case SECCAT_TEXT
from machopic_select_section undefining USE_SELECT_SECTION_FOR_FUNCTIONS
as suggested by rth as cleanup.

Honza

Index: opts.c
===
--- opts.c  (revision 167794)
+++ opts.c  (working copy)
@@ -738,6 +738,9 @@ finish_options (struct gcc_options *opts
   opts->x_flag_reorder_blocks = 1;
 }
 
+  if (opts->x_flag_reorder_blocks_and_partition)
+opts->x_flag_reorder_blocks = 1;
+
   /* If the target requested unwind info, then turn off the partitioning
  optimization with a different message.  Likewise, if the target does not
  support named sections.  */
Index: config/darwin.c
===
--- config/darwin.c (revision 167794)
+++ config/darwin.c (working copy)
@@ -1145,16 +1145,11 @@ darwin_mark_decl_preserved (const char *
 }
 
 static section *
-darwin_text_section (int reloc, int weak)
+darwin_text_section (int weak)
 {
-  if (reloc)
-return (weak
-   ? darwin_sections[text_unlikely_coal_section]
-   : unlikely_text_section ());
-  else
-return (weak
-   ? darwin_sections[text_coal_section]
-   : text_section);
+  return (weak
+ ? darwin_sections[text_coal_section]
+ : text_section);
 }
 
 static section *


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #19 from Jan Hubicka  2010-12-14 13:18:30 
UTC ---
Hi,
does the following patch fix the problem?
darwin_text_section no longer needs to care about hot/cold code since this is
already done in darwin_function_section.

In fact you might additionally consider putting 
  return (DECL_WEAK (decl)
  ? darwin_sections[text_coal_section]
  : text_section);
into places returning NULL in darwin_function_section, removing case
SECCAT_TEXT
from machopic_select_section undefining USE_SELECT_SECTION_FOR_FUNCTIONS
as suggested by rth as cleanup.

Honza

Index: opts.c
===
--- opts.c(revision 167794)
+++ opts.c(working copy)
@@ -738,6 +738,9 @@ finish_options (struct gcc_options *opts
   opts->x_flag_reorder_blocks = 1;
 }

+  if (opts->x_flag_reorder_blocks_and_partition)
+opts->x_flag_reorder_blocks = 1;
+
   /* If the target requested unwind info, then turn off the partitioning
  optimization with a different message.  Likewise, if the target does not
  support named sections.  */
Index: config/darwin.c
===
--- config/darwin.c(revision 167794)
+++ config/darwin.c(working copy)
@@ -1145,16 +1145,11 @@ darwin_mark_decl_preserved (const char *
 }

 static section *
-darwin_text_section (int reloc, int weak)
+darwin_text_section (int weak)
 {
-  if (reloc)
-return (weak
-? darwin_sections[text_unlikely_coal_section]
-: unlikely_text_section ());
-  else
-return (weak
-? darwin_sections[text_coal_section]
-: text_section);
+  return (weak
+  ? darwin_sections[text_coal_section]
+  : text_section);
 }

 static section *


[Bug fortran/46937] New: [4.6 Regression] gfortran.dg/pointer_intent_1.f90 FAILs with -fno-inline

2010-12-14 Thread zsojka at seznam dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46937

   Summary: [4.6 Regression] gfortran.dg/pointer_intent_1.f90
FAILs with -fno-inline
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: zso...@seznam.cz
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu


Created attachment 22752
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22752
reduced testcase

Output - original testcase:
$ gfortran -O -fno-inline -ftree-pre pointer_intent_1.f90
$ ./a.out 
Aborted

Output - reduced testcase:
$ gfortran -O -fno-inline testcase.f90
$ ./a.out 
Aborted

Tested revisions (reduced testcase):
r167770 - fail
r165699 - fail
r161659 - OK
4.5 r166509 - OK


[Bug target/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them

2010-12-14 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770

--- Comment #60 from Jan Hubicka  2010-12-14 13:25:32 
UTC ---
> Sure, if you want to play with that I have no principled objections. I only 
> add
> here that we probably have another related PR filed by Ian (is already in CC?)
> and that, as far as I know, those priorities don't work everywhere (I know 
> very
> little about init priorities in general, sorry)

Definitly the constructor priorities are not supported on non-GNU systems.  But
we can
probably chose iostream implementation based on configure test and fall back
into the
static constructor code.


[Bug testsuite/46938] New: FAIL: gcc.dg/pr43157.c (test for excess errors)

2010-12-14 Thread danglin at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46938

   Summary: FAIL: gcc.dg/pr43157.c (test for excess errors)
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: dang...@gcc.gnu.org
CC: da...@gcc.gnu.org
  Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
 Build: hppa64-hp-hpux11.11


Executing on host: /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/te
st/gnu/gcc/gcc/gcc/testsuite/gcc.dg/pr43157.c   -O1 -flto -fuse-linker-plugin 
-
lm   -o pr43157.exe(timeout = 300)
xgcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
compilation terminated.
compiler exited with status 1
output is:
xgcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
compilation terminated.

FAIL: gcc.dg/pr43157.c (test for excess errors)
Excess errors:
xgcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
compilation terminated.

With -v:

Reading specs from /test/gnu/gcc/objdir/gcc/specs
COLLECT_GCC=/test/gnu/gcc/objdir/gcc/xgcc
COLLECT_LTO_WRAPPER=/test/gnu/gcc/objdir/gcc/lto-wrapper
Target: hppa64-hp-hpux11.11
Configured with: ../gcc/configure --with-gnu-as --with-as=/opt/gnu64/bin/as
--with-ld=/usr/ccs/bin/ld --enable-shared --with-local-prefix=/opt/gnu64
--prefix=/opt/gnu64/gcc/gcc-4.6.0 --build=hppa64-hp-hpux11.11
--enable-threads=posix --disable-nls --with-gmp=/opt/gnu64/gcc/gcc-4.6.0
--with-libelf=/opt/gnu64 --enable-languages=c,c++,objc,obj-c++,fortran,lto
Thread model: posix
gcc version 4.6.0 20101214 (experimental) [trunk revision 167781] (GCC) 
COLLECT_GCC_OPTIONS='-B' '/test/gnu/gcc/objdir/gcc/' '-O1' '-flto'
'-fuse-linker-plugin' '-o' 'pr43157.exe' '-v'
 /test/gnu/gcc/objdir/gcc/cc1 -quiet -v -iprefix
/test/gnu/gcc/objdir/gcc/../lib/gcc/hppa64-hp-hpux11.11/4.6.0/ -isystem
/test/gnu/gcc/objdir/gcc/include -isystem
/test/gnu/gcc/objdir/gcc/include-fixed
/test/gnu/gcc/gcc/gcc/testsuite/gcc.dg/pr43157.c -quiet -dumpbase pr43157.c
-auxbase pr43157 -O1 -version -flto -fuse-linker-plugin -o /var/tmp//cc8dn1cK.s
GNU C (GCC) version 4.6.0 20101214 (experimental) [trunk revision 167781]
(hppa64-hp-hpux11.11)
compiled by GNU C version 4.6.0 20101214 (experimental) [trunk revision
167781], GMP version 5.0.1, MPFR version 2.4.2, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory
"/test/gnu/gcc/objdir/gcc/../lib/gcc/hppa64-hp-hpux11.11/4.6.0/include"
ignoring nonexistent directory
"/test/gnu/gcc/objdir/gcc/../lib/gcc/hppa64-hp-hpux11.11/4.6.0/include-fixed"
ignoring nonexistent directory
"/test/gnu/gcc/objdir/gcc/../lib/gcc/hppa64-hp-hpux11.11/4.6.0/../../../../hppa64-hp-hpux11.11/include"
ignoring nonexistent directory
"/test/gnu/gcc/objdir/gcc/../lib/gcc/../../lib/gcc/hppa64-hp-hpux11.11/4.6.0/include"
ignoring nonexistent directory
"/test/gnu/gcc/objdir/gcc/../lib/gcc/../../include"
ignoring nonexistent directory
"/test/gnu/gcc/objdir/gcc/../lib/gcc/../../lib/gcc/hppa64-hp-hpux11.11/4.6.0/include-fixed"
ignoring nonexistent directory
"/test/gnu/gcc/objdir/gcc/../lib/gcc/../../lib/gcc/hppa64-hp-hpux11.11/4.6.0/../../../../hppa64-hp-hpux11.11/include"
#include "..." search starts here:
#include <...> search starts here:
 /test/gnu/gcc/objdir/gcc/include
 /test/gnu/gcc/objdir/gcc/include-fixed
 /opt/gnu64/include
 /usr/include
End of search list.
GNU C (GCC) version 4.6.0 20101214 (experimental) [trunk revision 167781]
(hppa64-hp-hpux11.11)
compiled by GNU C version 4.6.0 20101214 (experimental) [trunk revision
167781], GMP version 5.0.1, MPFR version 2.4.2, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7ccd9647394182dfe07867e5fd941d9c
COLLECT_GCC_OPTIONS='-B' '/test/gnu/gcc/objdir/gcc/' '-O1' '-flto'
'-fuse-linker-plugin' '-o' 'pr43157.exe' '-v'
 /opt/gnu64/bin/as -v -o /var/tmp//ccAnbwpu.o /var/tmp//cc8dn1cK.s
GNU assembler version 2.20.51 (hppa64-hp-hpux11.11) using BFD version (GNU
Binutils) 2.20.51.20100309
xgcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
compilation terminated.

HP linker doesn't support linker plugins.


[Bug rtl-optimization/46649] [4.6 Regression] ICE: in move_bb_info, at sel-sched-ir.c:5080 with -fschedule-insns -fselective-scheduling

2010-12-14 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46649

--- Comment #6 from Alexander Monakov  2010-12-14 
13:28:06 UTC ---
Even though it is possible to unbreak
purge_empty_blocks/maybe_tidy_empty_bb/sel_merge_blocks for this case, I think
it's not worth it given that sel-sched generally expects somewhat clean CFG. 
So, just cleanup CFG at -O0.

I'll submit the following patch in a moment.

diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 3b5603c..5fe9ccb 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -7648,6 +7648,11 @@ run_selective_scheduling (void)
   if (n_basic_blocks == NUM_FIXED_BLOCKS)
 return;

+  /* Drop empty basic blocks, unreachable code, etc. if the scheduler is
+ invoked at -O0.  */
+  if (!optimize)
+cleanup_cfg (0);
+
   sel_global_init ();

   for (rgn = 0; rgn < nr_regions; rgn++)


[Bug target/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them

2010-12-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770

--- Comment #61 from Paolo Carlini  2010-12-14 
13:33:32 UTC ---
Agreed. If you can check that on GNU systems the trick actually works, I can
help with the boring autoconf bits (it would be easier if somebody could
outline a scheme for such test)


[Bug c/46902] [4.6 Regression] gcc.dg/plugin/plugindir*.c gives ICEs on powerpc-apple-darwin9

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46902

--- Comment #15 from Iain Sandoe  2010-12-14 13:41:02 
UTC ---
OK, seems to be related to _Bool vs. unsigned char.

e.g.:

  unsigned char x_exit_after_options;
#define exit_after_options global_options.x_exit_after_options

c.f.

  _Bool x_exit_after_options;
#define exit_after_options global_options.x_exit_after_options

not sure where that is coming from...


[Bug middle-end/45852] volatile structs are broken!

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45852

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|unassigned at gcc dot   |jakub at gcc dot gnu.org
   |gnu.org |

--- Comment #3 from Jakub Jelinek  2010-12-14 
13:43:42 UTC ---
Created attachment 22753
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22753
gcc46-pr45852.patch

Untested fix.  Alternatively if alt_rtl (or target?) has side-effects, we could
ignore it in store_expr.


[Bug fortran/46874] [OpenMP] ICE in gfc_conv_descriptor_data_get, at fortran/trans-array.c:147

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46874

--- Comment #6 from Jakub Jelinek  2010-12-14 
13:56:35 UTC ---
Author: jakub
Date: Tue Dec 14 13:56:25 2010
New Revision: 167798

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167798
Log:
PR fortran/46874
* trans-openmp.c (gfc_trans_omp_array_reduction): Handle allocatable
dummy variables.

* libgomp.fortran/allocatable6.f90: New test.

Added:
trunk/libgomp/testsuite/libgomp.fortran/allocatable6.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-openmp.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/46874] [OpenMP] ICE in gfc_conv_descriptor_data_get, at fortran/trans-array.c:147

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46874

--- Comment #7 from Jakub Jelinek  2010-12-14 
13:59:25 UTC ---
Author: jakub
Date: Tue Dec 14 13:59:20 2010
New Revision: 167799

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167799
Log:
PR fortran/46874
* trans-openmp.c (gfc_trans_omp_array_reduction): Handle allocatable
dummy variables.

* libgomp.fortran/allocatable6.f90: New test.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/libgomp/ChangeLog


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #20 from Dominique d'Humieres  
2010-12-14 14:02:47 UTC ---
(In reply to comment #13)
> I think this is a different problem - those messages are characteristic of
> dsymutil missing an input file.  This might be related to the changes 
> made to call dsymutil within collect2.

This is also seen in
http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01197.html

> Is it possible to isolate the command and run it with -v ? and/or -Wl,-debug ?

Well, it seems to be another "Heisenfailure"!-(private joke with Iain): if I
run the test alone, it succeeds but fails when tested as part of the full g++
suite.


[macbook] build_w/gcc% make -k check-g++ RUNTESTFLAGS="tree-prof.exp
--target_board=unix'{-m32,-m64}'"
... Skip common boring details ...
`if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo
${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool g++ tree-prof.exp
--target_board=unix'{-m32,-m64}' $runtestflags)
WARNING: Couldn't find the global config file.
Test Run By dominiq on Tue Dec 14 14:03:25 2010
Native configuration is x86_64-apple-darwin10.5.0

=== g++ tests ===

Schedule of variations:
unix/-m32
unix/-m64

Running target unix/-m32
Using /sw64/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw64/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...

=== g++ Summary for unix/-m32 ===

# of expected passes24
Running target unix/-m64
Using /sw64/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw64/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...

=== g++ Summary for unix/-m64 ===

# of expected passes24

=== g++ Summary ===

# of expected passes48
/opt/gcc/build_w/gcc/testsuite/g++/../../g++  version 4.6.0 20101213
(experimental) [trunk revision 167770p4] (GCC) 

[macbook] build_w/gcc% make -k check-g++
RUNTESTFLAGS="--target_board=unix'{-m32,-m64}'"
... Skip common boring details ...
`if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo
${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool g++
--target_board=unix'{-m32,-m64}' $runtestflags)
WARNING: Couldn't find the global config file.
Test Run By dominiq on Tue Dec 14 14:03:59 2010
Native configuration is x86_64-apple-darwin10.5.0

=== g++ tests ===

Schedule of variations:
unix/-m32
unix/-m64

Running target unix/-m32
... Skip boring details ...
Running /opt/gcc/work/gcc/testsuite/g++.dg/dg.exp ...
WARNING: g++.dg/ext/label13.C compilation failed to produce executable
... Skip boring details ...
Running /opt/gcc/work/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp
...
FAIL: g++.dg/torture/stackalign/eh-alloca-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-2.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-alloca-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-2.C  -O3 -g  execution test
Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...
FAIL: g++.dg/tree-prof/partition2.C compilation,  -g  -fprofile-use
FAIL: g++.dg/tree-prof/partition2.C compilation,  -O3 -g  -fprofile-use
Running /opt/gcc/work/gcc/testsuite/g++.dg/vect/vect.exp ...
Running /opt/gcc/work/gcc/testsuite/g++.old-deja/old-deja.exp ...

=== g++ Summary for unix/-m32 ===

# of expected passes26164
# of unexpected failures8
# of expected failures157
# of unresolved testcases2
# of unsupported tests176
Running target unix/-m64
... Skip boring details ...
Running /opt/gcc/work/gcc/testsuite/g++.dg/dg.exp ...
WARNING: g++.dg/ext/label13.C compilation failed to produce executable
... Skip boring details ...
Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...
FAIL: g++.dg/tree-prof/partition2.C compilation,  -g  -fprofile-use
FAIL: g++.dg/tree-prof/partition2.C compilation,  -O3 -g  -fprofile-use
Running /opt/gcc/work/gcc/testsuite/g++.dg/vect/vect.exp ...
Running /opt/gcc/work/gcc/testsuite/g++.old-deja/old-deja.exp ...

=== g++ Summary for unix/-m64 ===

# of expected passes26410
# of unexpected failures2
# of expected failures157
# of unresolved testcases2
# of unsupported tests370

=== g++ Summary ===

# of expected passes52574
# of unexpected failures10
# of expected failures314
# of unresolved testcases4
# of unsupported tests546
/opt/gcc/build_w/gcc/tes

[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #21 from Iain Sandoe  2010-12-14 14:04:58 
UTC ---
(In reply to comment #19)
> Hi,
> does the following patch fix the problem?
> darwin_text_section no longer needs to care about hot/cold code since this is
> already done in darwin_function_section.
> 
> In fact you might additionally consider putting 
>   return (DECL_WEAK (decl)
>   ? darwin_sections[text_coal_section]
>   : text_section);
> into places returning NULL in darwin_function_section, removing case
> SECCAT_TEXT
> from machopic_select_section undefining USE_SELECT_SECTION_FOR_FUNCTIONS
> as suggested by rth as cleanup.

like this?
 (fixes the specific problem - but not reg-tested):


Index: gcc/opts.c
===
--- gcc/opts.c(revision 167793)
+++ gcc/opts.c(working copy)
@@ -723,6 +723,9 @@ finish_options (struct gcc_options *opts, struct g
   opts->x_flag_reorder_blocks = 1;
 }

+  if (opts->x_flag_reorder_blocks_and_partition)
+opts->x_flag_reorder_blocks = 1;
+
   /* If user requested unwind info, then turn off the partitioning
  optimization.  */

Index: gcc/config/darwin.c
===
--- gcc/config/darwin.c(revision 167793)
+++ gcc/config/darwin.c(working copy)
@@ -1145,19 +1145,6 @@ darwin_mark_decl_preserved (const char *name)
 }

 static section *
-darwin_text_section (int reloc, int weak)
-{
-  if (reloc)
-return (weak
-? darwin_sections[text_unlikely_coal_section]
-: unlikely_text_section ());
-  else
-return (weak
-? darwin_sections[text_coal_section]
-: text_section);
-}
-
-static section *
 darwin_rodata_section (int weak, bool zsize)
 {
   return (weak
@@ -1267,17 +1254,7 @@ machopic_select_section (tree decl,
   switch (categorize_decl_for_section (decl, reloc))
 {
 case SECCAT_TEXT:
-  {
-struct cgraph_node *node;
-if (decl && TREE_CODE (decl) == FUNCTION_DECL
-&& (node = cgraph_get_node (decl)) != NULL)
-  base_section = darwin_function_section (decl,
-  node->frequency,
-  node->only_called_at_startup,
-  node->only_called_at_exit);
-if (!base_section)
-  base_section = darwin_text_section (reloc, weak);
-  }
+  gcc_unreachable ();
   break;

 case SECCAT_RODATA:
@@ -2969,7 +2946,10 @@ darwin_function_section (tree decl, enum node_freq
   bool startup, bool exit)
 {
   if (!flag_reorder_functions)
-return NULL;
+return (DECL_WEAK (decl)
+? darwin_sections[text_coal_section]
+: text_section);
+
   /* Startup code should go to startup subsection unless it is
  unlikely executed (this happens especially with function splitting
  where we can split away unnecesary parts of static constructors.  */
@@ -2994,7 +2974,9 @@ darwin_function_section (tree decl, enum node_freq
 return get_named_text_section
  (decl, "__TEXT,__hot,regular,pure_instructions", "_hot");
   default:
-return NULL;
+return (DECL_WEAK (decl)
+? darwin_sections[text_coal_section]
+: text_section);
 }
 }

Index: gcc/config/darwin.h
===
--- gcc/config/darwin.h(revision 167793)
+++ gcc/config/darwin.h(working copy)
@@ -664,7 +664,7 @@ extern GTY(()) section * darwin_sections[NUM_DARWI

 #undefTARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION machopic_select_section
-#define USE_SELECT_SECTION_FOR_FUNCTIONS
+
 #undefTARGET_ASM_FUNCTION_SECTION
 #define TARGET_ASM_FUNCTION_SECTION darwin_function_section


[Bug tree-optimization/46909] [4.6 Regression] Logical OR expressions are miscompiled

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46909

--- Comment #9 from Jakub Jelinek  2010-12-14 
14:10:09 UTC ---
Author: jakub
Date: Tue Dec 14 14:09:59 2010
New Revision: 167800

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167800
Log:
PR tree-optimization/46909
* gimple-fold.c (and_var_with_comparison_1): Save partial
result even in the is_and case, if both partial results
are the same, return it.
(or_var_with_comparison_1): Use is_or predicate instead of
innercode == TRUTH_OR_EXPR test.  Save partial result
even in the is_or case, if both partial results are the
same, return it.  In the !is_or case when both partial
results are the same, return the partial result instead
of boolean_true_node.

* gcc.c-torture/execute/pr46909-1.c: New test.
* gcc.c-torture/execute/pr46909-2.c: New test.
* gcc.dg/pr46909.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr46909-1.c
trunk/gcc/testsuite/gcc.c-torture/execute/pr46909-2.c
trunk/gcc/testsuite/gcc.dg/pr46909.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-fold.c
trunk/gcc/testsuite/ChangeLog


[Bug middle-end/46885] [4.6 Regression] ICE: in gsi_insert_seq_nodes_after, at gimple-iterator.c:251 with -ftree-parallelize-loops -g

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46885

--- Comment #3 from Jakub Jelinek  2010-12-14 
14:11:25 UTC ---
Author: jakub
Date: Tue Dec 14 14:11:16 2010
New Revision: 167801

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167801
Log:
PR debug/46885
* tree-ssa-loop-manip.c (canonicalize_loop_ivs): Use gsi_last_bb
instead of gsi_last_nondebug_bb if bump_in_latch.

* gcc.dg/autopar/pr46885.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/autopar/pr46885.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-loop-manip.c


[Bug target/46883] GCC ICE with error: unrecognizable insn

2010-12-14 Thread cltang at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46883

Chung-Lin Tang  changed:

   What|Removed |Added

 CC||cltang at gcc dot gnu.org

--- Comment #4 from Chung-Lin Tang  2010-12-14 
14:12:40 UTC ---
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01096.html


[Bug middle-end/46935] We should recognize expanded switch statement and convert 2 way switch statements into shift & mask test

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46935

Jan Hubicka  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2010.12.14 14:14:18
 Ever Confirmed|0   |1

--- Comment #3 from Jan Hubicka  2010-12-14 
14:14:18 UTC ---
I would do the conversion always when we can turn more than one if into signle
switch.  Doing so reduces the amount of IL and makes program easier to
analyze&opotimize. We should rely on switch expansion code doing the right
thing producing back the ifs when profitable.


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #22 from Dominique d'Humieres  
2010-12-14 14:17:53 UTC ---
I have found the reason of the unexpected pass when testing tree-prof.exp
alone: -g is not passed to the tests. If I force it I get

=== g++ tests ===

Schedule of variations:
unix/-m32/-g
unix/-m64/-g

Running target unix/-m32/-g
Using /sw64/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw64/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...
FAIL: g++.dg/tree-prof/partition1.C compilation,  -fprofile-use
FAIL: g++.dg/tree-prof/partition2.C compilation,  -fprofile-use

=== g++ Summary for unix/-m32/-g ===

# of expected passes20
# of unexpected failures2
# of unresolved testcases2
Running target unix/-m64/-g
Using /sw64/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw64/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...
FAIL: g++.dg/tree-prof/partition1.C compilation,  -fprofile-use
FAIL: g++.dg/tree-prof/partition2.C compilation,  -fprofile-use

=== g++ Summary for unix/-m64/-g ===

# of expected passes20
# of unexpected failures2
# of unresolved testcases2

=== g++ Summary ===

# of expected passes40
# of unexpected failures4
# of unresolved testcases4
/opt/gcc/build_w/gcc/testsuite/g++/../../g++  version 4.6.0 20101213
(experimental) [trunk revision 167770p4] (GCC) 

make[1]: [check-parallel-g++] Error 1 (ignored)

Is this expected or should I fill another PR?


[Bug c++/46646] [trans-mem] __cxa_rethrow and __builtin_eh_pointer are unsafe

2010-12-14 Thread aldyh at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46646

Aldy Hernandez  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #3 from Aldy Hernandez  2010-12-14 
14:20:43 UTC ---
Fixed and committed:
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01097.html


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #23 from Iain Sandoe  2010-12-14 14:23:42 
UTC ---
(In reply to comment #22)
> I have found the reason of the unexpected pass when testing tree-prof.exp
> alone: -g is not passed to the tests. If I force it I get


> Using /sw64/share/dejagnu/config/unix.exp as generic interface file for 
> target.
> Using /opt/gcc/work/gcc/testsuite/config/default.exp as
> tool-and-target-specific interface file.
> Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...
> FAIL: g++.dg/tree-prof/partition1.C compilation,  -fprofile-use
> FAIL: g++.dg/tree-prof/partition2.C compilation,  -fprofile-use


> Is this expected or should I fill another PR?

I suspect it is a different issue...  can we look at the output with "-v" and
"-Wl,-debug" ?


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #24 from Jack Howarth  2010-12-14 
14:30:55 UTC ---
(In reply to comment #23)
> (In reply to comment #22)
> > I have found the reason of the unexpected pass when testing tree-prof.exp
> > alone: -g is not passed to the tests. If I force it I get
> 
> 
> > Using /sw64/share/dejagnu/config/unix.exp as generic interface file for 
> > target.
> > Using /opt/gcc/work/gcc/testsuite/config/default.exp as
> > tool-and-target-specific interface file.
> > Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...
> > FAIL: g++.dg/tree-prof/partition1.C compilation,  -fprofile-use
> > FAIL: g++.dg/tree-prof/partition2.C compilation,  -fprofile-use
> 
> 
> > Is this expected or should I fill another PR?
> 
> I suspect it is a different issue...  can we look at the output with "-v" and
> "-Wl,-debug" ?

Also look at PR45646 which may be related and could have gone latent rather
than have been fixed.


[Bug ada/46939] New: http://blog.regehr.org/archives/320 example 6

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46939

   Summary: http://blog.regehr.org/archives/320 example 6
   Product: gcc
   Version: 4.6.0
   URL: http://blog.regehr.org/archives/320
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ada
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ja...@gcc.gnu.org
CC: hubi...@gcc.gnu.org


The reason we don't expand / 10 using a multiplication is because gcc thinks it
happens in cold code.

In *.optimized we have:
  # BLOCK 5 freq:
  # PRED: 4 [100.0%]  (fallthru,exec) 2 [33.3%]  (exec)
  # PT = nonlocal 

  # strD.1584_1 = PHI 
  # signD.1590_5 = PHI 
:
  str.0D.2703_18 = (long unsigned intD.4) strD.1584_1;
  end.1D.2704_19 = (long unsigned intD.4) endD.1592_13;
  if (str.0D.2703_18 < end.1D.2704_19)
goto ;
  else
goto ;
  # SUCC: 6 [4.0%]  (true,exec) 22 [96.0%]  (false,exec)

  # BLOCK 6 freq:400
  # PRED: 5 [4.0%]  (true,exec)
  # VUSE <.MEMD.2753_65(D)>
  D.2701_20 = *strD.1584_1;
  if (D.2701_20 > 48)
goto ;
  else
goto ;
  # SUCC: 7 [4.0%]  (true,exec) 22 [96.0%]  (false,exec)

  # BLOCK 7 freq:16
  # PRED: 6 [4.0%]  (true,exec)
  if (D.2701_20 <= 57)
goto ;
  else
goto ;
  # SUCC: 8 [4.0%]  (true,exec) 22 [96.0%]  (false,exec)
...
  # BLOCK 15 freq:6
  # PRED: 14 [96.0%]  (true,exec)
  D.2735_44 = (long intD.2) digitD.1591_43;
  D.2736_45 = 9223372036854775807 - D.2735_44;
  D.2737_46 = D.2736_45 / 10;
  if (ctx_valueD.1589_3 <= D.2737_46)
goto ;
  else
goto ;
  # SUCC: 16 [96.0%]  (true,exec) 22 [4.0%]  (false,exec)

while ((unsigned long) str < (unsigned long) end) is a loop, not sure why we
predict the loop header to terminate immediately, and both the >= 48 and <= 57
tests have return -1; in the other branch, so it is also strange to see them
predicted so unlikely.  Honza?


[Bug tree-optimization/46909] [4.6 Regression] Logical OR expressions are miscompiled

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46909

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #10 from Jakub Jelinek  2010-12-14 
14:32:35 UTC ---
Fixed.


[Bug c/46902] [4.6 Regression] gcc.dg/plugin/plugindir*.c gives ICEs on powerpc-apple-darwin9

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46902

--- Comment #16 from Iain Sandoe  2010-12-14 14:34:59 
UTC ---
this is a fix (but, clearly, there's something fragile here).
 #include 
 includes 

I'm not sure why that should cause a problem since the translation of bool to
int should not be active for gcc >= 3 : 

#definebool_Bool
#if __STDC_VERSION__ < 199901L && __GNUC__ < 3
typedefint_Bool;
#endif




Index: gcc/plugin.c
===
--- gcc/plugin.c(revision 167762)
+++ gcc/plugin.c(working copy)
@@ -22,6 +22,13 @@ along with GCC; see the file COPYING3.  If not see

 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "diagnostic-core.h"
+#include "tree.h"
+#include "tree-pass.h"
+#include "intl.h"
+#include "timevar.h"
+#include "ggc.h"

 /* If plugin support is not enabled, do not try to execute any code
that may reference libdl.  The generic code is still compiled in to
@@ -31,14 +38,7 @@ along with GCC; see the file COPYING3.  If not see
 #include 
 #endif

-#include "coretypes.h"
-#include "diagnostic-core.h"
-#include "tree.h"
-#include "tree-pass.h"
-#include "intl.h"
 #include "plugin.h"
-#include "timevar.h"
-#include "ggc.h"

 #ifdef ENABLE_PLUGIN
 #include "plugin-version.h"


[Bug fortran/46937] [4.6 Regression] gfortran.dg/pointer_intent_1.f90 FAILs with -fno-inline

2010-12-14 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46937

Tobias Burnus  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2010.12.14 14:36:06
 CC||burnus at gcc dot gnu.org
   Target Milestone|--- |4.6.0
 Ever Confirmed|0   |1

--- Comment #1 from Tobias Burnus  2010-12-14 
14:36:06 UTC ---
Confirmed. Thanks for the report!

The function annotation patch (PR 43665) was seemingly too eager. The problem
is that the object itself ("t") may not be changed - but pointers it contains
may. In that sense, it resembles a bit PR 45586.

Patch:

--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2325,7 +2325,11 @@ create_fn_spec (gfc_symbol *sym, tree fntype)
 if (spec_len < sizeof (spec))
   {
if (!f->sym || f->sym->attr.pointer || f->sym->attr.target
-   || f->sym->attr.external || f->sym->attr.cray_pointer)
+   || f->sym->attr.external || f->sym->attr.cray_pointer
+   || (f->sym->ts.type == BT_DERIVED
+   && f->sym->ts.u.derived->attr.pointer_comp)
+   || (f->sym->ts.type == BT_CLASS
+   && CLASS_DATA (f->sym)->ts.u.derived->attr.pointer_comp))
  spec[spec_len++] = '.';
else if (f->sym->attr.intent == INTENT_IN)
  spec[spec_len++] = 'r';


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #25 from Jack Howarth  2010-12-14 
14:35:46 UTC ---
(In reply to comment #21)

> like this?
>  (fixes the specific problem - but not reg-tested):
> 
> 

This is in addition to the patch from Comment 7, right?


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #26 from Jack Howarth  2010-12-14 
14:37:52 UTC ---
(In reply to comment #25)
> (In reply to comment #21)
> 
> > like this?
> >  (fixes the specific problem - but not reg-tested):
> > 
> > 
> 
> This is in addition to the patch from Comment 7, right?

Nevermind. I see it replaces it.


[Bug rtl-optimization/46649] [4.6 Regression] ICE: in move_bb_info, at sel-sched-ir.c:5080 with -fschedule-insns -fselective-scheduling

2010-12-14 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46649

--- Comment #7 from Alexander Monakov  2010-12-14 
14:38:38 UTC ---
After a discussion with Andrey and refreshing my memory on that code I think
it's actually better to unbreak purge_empty_blocks in this case.  It used to be
correct, i.e. it never attempted to delete the first BB in the region; then I
broke it because I wasn't aware of the limitation w.r.t. removal of the first
BB.

Sorry for the spam.

diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 427fd22..9f0c4a3 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -3749,10 +3749,10 @@ tidy_control_flow (basic_block xbb, bool full_tidying)
 void
 purge_empty_blocks (void)
 {
-  /* Do not attempt to delete preheader.  */
-  int i = sel_is_loop_preheader_p (BASIC_BLOCK (BB_TO_BLOCK (0))) ? 1 : 0;
+  int i;

-  while (i < current_nr_blocks)
+  /* Do not attempt to delete the first basic block in the region.  */
+  for (i = 1; i < current_nr_blocks; i++)
 {
   basic_block b = BASIC_BLOCK (BB_TO_BLOCK (i));


[Bug middle-end/46885] [4.6 Regression] ICE: in gsi_insert_seq_nodes_after, at gimple-iterator.c:251 with -ftree-parallelize-loops -g

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46885

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #4 from Jakub Jelinek  2010-12-14 
14:39:38 UTC ---
Fixed.


[Bug middle-end/45852] volatile structs are broken!

2010-12-14 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45852

Alexander Monakov  changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org

--- Comment #4 from Alexander Monakov  2010-12-14 
14:54:38 UTC ---
There's a couple of related bugs:

Optimizes away access to volatile field (unconfirmed):
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46762

Does not use volatile MEMs for assignments of structs with volatile fields:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45472


[Bug target/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them

2010-12-14 Thread mark at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770

--- Comment #62 from Mark Mitchell  2010-12-14 
15:17:25 UTC ---
> Having everyone with knowledge of static construction alerted, can't we use 
> the
> GNU constructor priorities to solve PR44952?

The two constraints are:

(a) priorities aren't supported on all systems, so we need to have a
fall-back mechanism

(b) we need to document which range of priorities we're reserving for
libstdc++

On RTOS platforms, high priorities are also used for things like C
library initialization and even for device initialization.

Thank you,


[Bug middle-end/46923] [trans-mem] thread-local memory variable not properly logged

2010-12-14 Thread aldyh at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46923

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||aldyh at gcc dot gnu.org
 Resolution||FIXED

--- Comment #1 from Aldy Hernandez  2010-12-14 
15:31:34 UTC ---
Fixed by:
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01101.html


[Bug lto/46940] New: asm aliases with linker plugin segfaults

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46940

   Summary: asm aliases with linker plugin segfaults
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: hubi...@gcc.gnu.org


extern __attribute__((visibility("hidden"))) void _moz_foo (void);
extern __typeof (_moz_foo) _moz_foo __asm__ ("" "INT__foo")
__attribute__((__visibility__("hidden"))) ;
void _moz_foo(void)
{
  printf ("blah\n");
}
extern __typeof (_moz_foo) EXT__foo __asm__("" "_moz_foo")
__attribute__((__alias__("" "INT__foo")));
evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# more t2.c
extern void _moz_foo (void);
main()
{
  _moz_foo ();
}
evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# ./xgcc -B ./ -O2 -flto t.c t2.c
-fuse-linker-plugin
t.c: In function ?_moz_foo?:
t.c:5:3: warning: incompatible implicit declaration of built-in function
?printf? [enabled by default]
lto1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
lto-wrapper: ./xgcc returned 1 exit status
lto-wrapper failedcollect2: ld returned 1 exit status

The problem here is that we get prevailing definition of _moz_foo to be alias
that has no cgraph node (nor alias node) attached. Bah.


[Bug lto/45375] [meta-bug] Issues with building Mozilla with LTO

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375

Jan Hubicka  changed:

   What|Removed |Added

 Depends on||46940

--- Comment #18 from Jan Hubicka  2010-12-14 
15:36:47 UTC ---
Filled in the sefault as PR46940
It is really a sickness of mozilla sources definint _INT symbol, _moz symbol
and function of same name and visibility and using both. In any case we should
handle this gratefully too.

Honza


[Bug c++/46941] New: [trans-mem] new/delete operator are unsafe

2010-12-14 Thread patrick.marlier at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46941

   Summary: [trans-mem] new/delete operator are unsafe
   Product: gcc
   Version: trans-mem
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: patrick.marl...@gmail.com
CC: r...@gcc.gnu.org, al...@gcc.gnu.org


Created attachment 22754
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22754
testcase for new delete

The new/delete are not considered safe even if GCC managed and replaced to
transaction_safe ones.

g++ -fgnu-tm -Wall -o newdelete newdelete.cpp
newdelete.cpp:38:13: error: unsafe function call ‘void operator delete
[](void*)’ within ‘transaction_safe’ function
newdelete.cpp:32:19: error: unsafe function call ‘void* operator new [](long
unsigned int)’ within ‘transaction_safe’ function
newdelete.cpp:26:11: error: unsafe function call ‘void operator delete(void*)’
within ‘transaction_safe’ function
newdelete.cpp:20:14: error: unsafe function call ‘void* operator new(long
unsigned int)’ within ‘transaction_safe’ function


[Bug rtl-optimization/46920] suboptimal register allocation with local register variables

2010-12-14 Thread vmakarov at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46920

--- Comment #3 from Vladimir Makarov  2010-12-14 
16:02:09 UTC ---
(In reply to comment #2)
> > To generate the proposed code, we should assign r12 to p63.  IRA marks p63
> > conflicting with r12 because DF-infrastructure reports r12 having 
> > intersected
> > live ranges with p63.
> >
> > It is possible to solve the problem if we have conflicts based on values 
> > (not
> > live ranges).  I'd not recommend to do that, because it will slow down RA
> > without visible improvement on majority benchmarks (I did such experiment 
> > about
> > 7 years ago and reported about the results on GCC summit in 2004).
> 
> One alternative is to rematerialize values that have been copied to a
> hard register before their uses (by inserting an r12:DI=r63:DI before
> the use of r63).  This breaks the live ranges of the pseudos and
> facilitates coalescing.
> 

I'd not call it rematerialization.  I think it is more live range shrinking
(LRS) of hard register through additional copies.  It is an interesting idea (I
partially investigated LRS about 6 years ago).  Probably I should think about
this again.  Thanks, Paolo.

> > By the way, usage of implicit hard registers in RTL (when it can be avoided.
> > Example when hard registers can be avoided is their usage as call 
> > arguments) is
> > very bad idea for RA.  I see it a lot such code in x86-64 code.  I'd 
> > recommend
> > to prevent optimizations before RA to abuse hard register usage.
> 
> As I said, the improvement from hard register variable here is 25% on
> x86-64 and probably more (I can collect data) on i386.  This testcase
> is distilled from a bytecode interpreter.

Paolo, I did not mean that you should avoid to use hard register in this
particular case.  I just wrote that I saw a lot x86-64 code where hard
registers were propagated and that is a bad for RA.  I never had an opportunity
to investigate what optimization does it.

Again by the way :).  My experience with implementation of interpreters shows
me that usage of computed gotos does not work well (especially when there are a
lot such labels) with modern OOO processors because of worse branch
predictions.  I found a switch statement works better.  But I guess it is not
your goal to rewrite the interpriter.


[Bug lto/46940] asm aliases with linker plugin segfaults

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46940

Jan Hubicka  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2010.12.14 16:20:51
 Blocks|45375   |
 Ever Confirmed|0   |1

--- Comment #1 from Jan Hubicka  2010-12-14 
16:20:51 UTC ---
testing patch...


[Bug lto/44463] whopr does not work with weak functions

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44463

Jan Hubicka  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2010.12.14 16:28:19
 CC||hubicka at gcc dot gnu.org
 Ever Confirmed|0   |1

--- Comment #4 from Jan Hubicka  2010-12-14 
16:28:19 UTC ---
mine. testing patch.


[Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto

2010-12-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45721

Jan Hubicka  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #4 from Jan Hubicka  2010-12-14 
16:32:39 UTC ---
mine.


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #27 from Iain Sandoe  2010-12-14 16:39:29 
UTC ---
(In reply to comment #23)
> (In reply to comment #22)

> > Running /opt/gcc/work/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp ...
> > FAIL: g++.dg/tree-prof/partition1.C compilation,  -fprofile-use
> > FAIL: g++.dg/tree-prof/partition2.C compilation,  -fprofile-use

hm.  AFAIU, these should not work because exceptions code is incompatible with
reordering - or has this changed?


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #28 from Iain Sandoe  2010-12-14 16:41:02 
UTC ---
more of a problem is:

FAIL: g++.dg/pch/system-1.C  -g assembly comparison
FAIL: g++.dg/pch/system-1.C  -O2 -g assembly comparison
FAIL: g++.dg/pch/system-1.C  -O2 assembly comparison
FAIL: g++.dg/pch/system-2.C  -g assembly comparison
FAIL: g++.dg/pch/system-2.C  -O2 -g assembly comparison
FAIL: g++.dg/pch/system-2.C  -O2 assembly comparison


[Bug c++/46654] [trans-mem] "volatile" objects must not be allowed in a safe statement

2010-12-14 Thread aldyh at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46654

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2010.12.14 16:41:22
 Ever Confirmed|0   |1

--- Comment #2 from Aldy Hernandez  2010-12-14 
16:41:22 UTC ---
Fixed and awaiting approval:
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01103.html


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #29 from Dominique d'Humieres  
2010-12-14 16:44:09 UTC ---
Partial tests (x86_64-apple-darwin10.5.0) with the patch in comment #21 (with
the one in comment #7 reverted) show that the pr is fixed, but it introduces at
least one regression for both -m32/64:

FAIL: g++.dg/other/pr22003.C (test for excess errors)

[macbook] f90/bug% g++46 -O2 -fno-exceptions -freorder-blocks-and-partition
/opt/gcc/work/gcc/testsuite/g++.dg/other/pr22003.C
/opt/gcc/work/gcc/testsuite/g++.dg/other/pr22003.C: In destructor 'virtual
c3::~c3()':
/opt/gcc/work/gcc/testsuite/g++.dg/other/pr22003.C:17:8: error: virtual
c3::~c3() causes a section type conflict
/opt/gcc/work/gcc/testsuite/g++.dg/other/pr22003.C:17:8: error: virtual
c3::~c3() causes a section type conflict
/opt/gcc/work/gcc/testsuite/g++.dg/other/pr22003.C:17:8: error: virtual
c3::~c3() causes a section type conflict


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #30 from Iain Sandoe  2010-12-14 16:46:19 
UTC ---
PASS: g++.dg/pch/system-1.C  -O2 -g -I. (test for excess errors)
line #35
<
__GLOBAL__sub_I__GCC_gcc_live_trunk_gcc_testsuite_g__.dg_pch_system_1.C_867072EB_0966702C:
> __GLOBAL__sub_I__GCC_gcc_live_trunk_gcc_testsuite_g__.dg_pch_system_1.C_867072EB_1FC588D5:
line #72
<   .long  
__GLOBAL__sub_I__GCC_gcc_live_trunk_gcc_testsuite_g__.dg_pch_system_1.C_867072EB_0966702C
>   .long   
> __GLOBAL__sub_I__GCC_gcc_live_trunk_gcc_testsuite_g__.dg_pch_system_1.C_867072EB_1FC588D5
line #251
<
__GLOBAL__sub_I__GCC_gcc_live_trunk_gcc_testsuite_g__.dg_pch_system_1.C_867072EB_0966702C.eh:
> __GLOBAL__sub_I__GCC_gcc_live_trunk_gcc_testsuite_g__.dg_pch_system_1.C_867072EB_1FC588D5.eh:
line #1373
<   .ascii
"_GLOBAL__sub_I__GCC_gcc_live_trunk_gcc_testsuite_g__.dg_pch_system_1.C_867072EB_0966702C\0"
>   .ascii 
> "_GLOBAL__sub_I__GCC_gcc_live_trunk_gcc_testsuite_g__.dg_pch_system_1.C_867072EB_1FC588D5\0"
FAIL: g++.dg/pch/system-1.C  -O2 -g assembly comparison


[Bug rtl-optimization/46920] suboptimal register allocation with local register variables

2010-12-14 Thread bonzini at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46920

--- Comment #4 from Paolo Bonzini  2010-12-14 16:48:20 
UTC ---
Yes, I agree that excessive peppering of the code with register asm causes
worse performance.  The interpreter is only placing the very hot ip and sp
registers in hard-coded registers.

I can take a look at the optimization but it may take some time.


[Bug target/46942] New: x86_64 parameter passing unnecessary sign/zero extends

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942

   Summary: x86_64 parameter passing unnecessary sign/zero extends
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ja...@gcc.gnu.org
CC: hubi...@gcc.gnu.org
Target: x86_64-linux


It seems we zero/sign extend < 64-bit integral parameters into 64-bit registers
both on the caller and callee side on x86_64, one of those should be redundant.
In http://blog.regehr.org/archives/320 Example 4 it seems that LLVM probably
only zero/sign extends in the caller, not callee, not sure what ICC does.

__attribute__((noinline, noclone))
unsigned long f1 (unsigned int a, int b, unsigned short c, short d, unsigned
char e, signed char f)
{
  return (unsigned long) a + b + c + d + e + f;
}

unsigned long l;

unsigned long f2 (void)
{
  return f1 (l + 41, l + 41, l + 41, l + 41, l + 41, l + 41);
}

unsigned long f3 (unsigned int a, int b, unsigned short c, short d, unsigned
char e, signed char f)
{
  return foo (a, b, c, d, e, f);
}


[Bug fortran/46937] [4.6 Regression] gfortran.dg/pointer_intent_1.f90 FAILs with -fno-inline

2010-12-14 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46937

--- Comment #2 from Tobias Burnus  2010-12-14 
17:09:50 UTC ---
Author: burnus
Date: Tue Dec 14 17:09:33 2010
New Revision: 167806

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167806
Log:
2010-12-14  Tobias Burnus  

PR fortran/46937
* trans-types.c (create_fn_spec): "."-annotate derived types
with (proc-)pointer components.

2010-12-14  Tobias Burnus  

PR fortran/46937
* gfortran.dg/pointer_intent_4.f90: New.


Added:
trunk/gcc/testsuite/gfortran.dg/pointer_intent_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-types.c
trunk/gcc/testsuite/ChangeLog


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #31 from Jack Howarth  2010-12-14 
17:09:47 UTC ---
With the patch from comment 21 applied on x86_64-apple-darwin10, I am seeing...

FAIL: gcc.dg/darwin-weakimport-3.c scan-assembler-not coalesced
FAIL: gcc.dg/pr25376.c scan-assembler my_named_section


[Bug c++/45544] ICE: in sese_adjust_liveout_phis, at sese.c:633

2010-12-14 Thread spop at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45544

Sebastian Pop  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED

--- Comment #5 from Sebastian Pop  2010-12-14 17:12:02 
UTC ---
Fixed.
Both trunk and the 4.5 branch are not ICE-ing on this testcase.


[Bug target/46942] x86_64 parameter passing unnecessary sign/zero extends

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942

--- Comment #1 from Jakub Jelinek  2010-12-14 
17:13:19 UTC ---
__attribute__((noinline, noclone))
unsigned long f1 (unsigned int a, int b, unsigned short c, short d, unsigned
char e, signed char f)
{
  return (unsigned long) a + b + c + d + e + f;
}

unsigned long l;

unsigned long f2 (void)
{
  return f1 (l + 41, l + 41, l + 41, l + 41, l + 41, l + 41) + 1;
}

unsigned long f3 (unsigned int a, int b, unsigned short c, short d, unsigned
char e, signed char f)
{
  return f1 (a, b, c, d, e, f);
}

unsigned long f4 (int a, unsigned int b, short c, unsigned short d, signed char
e, unsigned char f)
{
  return f1 (a, b, c, d, e, f);
}

at -O2 shows in f4 that we can't trust that the sign/zero extension is done on
the caller side, at least we can't trust that it is sign/zero extended into
64-bits.


[Bug fortran/46937] [4.6 Regression] gfortran.dg/pointer_intent_1.f90 FAILs with -fno-inline

2010-12-14 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46937

Tobias Burnus  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #3 from Tobias Burnus  2010-12-14 
17:13:17 UTC ---
FIXED on the trunk (4.6). Thanks again for the bug report!


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #32 from Iain Sandoe  2010-12-14 17:16:39 
UTC ---
minor update (this removes a test for reorder & partition + exceptions that is
carried out too early)

Tests for reorder + exceptions and reorder + unwind are carried out in opts.c
now.



Index: gcc/opts.c
===
--- gcc/opts.c(revision 167793)
+++ gcc/opts.c(working copy)
@@ -723,6 +723,9 @@ finish_options (struct gcc_options *opts, struct g
   opts->x_flag_reorder_blocks = 1;
 }

+  if (opts->x_flag_reorder_blocks_and_partition)
+opts->x_flag_reorder_blocks = 1;
+
   /* If user requested unwind info, then turn off the partitioning
  optimization.  */

Index: gcc/config/darwin.c
===
--- gcc/config/darwin.c(revision 167793)
+++ gcc/config/darwin.c(working copy)
@@ -1145,19 +1145,6 @@ darwin_mark_decl_preserved (const char *name)
 }

 static section *
-darwin_text_section (int reloc, int weak)
-{
-  if (reloc)
-return (weak
-? darwin_sections[text_unlikely_coal_section]
-: unlikely_text_section ());
-  else
-return (weak
-? darwin_sections[text_coal_section]
-: text_section);
-}
-
-static section *
 darwin_rodata_section (int weak, bool zsize)
 {
   return (weak
@@ -1267,17 +1254,7 @@ machopic_select_section (tree decl,
   switch (categorize_decl_for_section (decl, reloc))
 {
 case SECCAT_TEXT:
-  {
-struct cgraph_node *node;
-if (decl && TREE_CODE (decl) == FUNCTION_DECL
-&& (node = cgraph_get_node (decl)) != NULL)
-  base_section = darwin_function_section (decl,
-  node->frequency,
-  node->only_called_at_startup,
-  node->only_called_at_exit);
-if (!base_section)
-  base_section = darwin_text_section (reloc, weak);
-  }
+  gcc_unreachable ();
   break;

 case SECCAT_RODATA:
@@ -2559,17 +2536,6 @@ darwin_override_options (void)
   if (!global_options_set.x_dwarf_strict) 
 dwarf_strict = 1;

-  /* Disable -freorder-blocks-and-partition for darwin_emit_unwind_label.  */
-  if (flag_reorder_blocks_and_partition 
-  && (targetm.asm_out.emit_unwind_label == darwin_emit_unwind_label))
-{
-  inform (input_location,
-  "-freorder-blocks-and-partition does not work with exceptions "
-  "on this architecture");
-  flag_reorder_blocks_and_partition = 0;
-  flag_reorder_blocks = 1;
-}
-
   if (flag_mkernel || flag_apple_kext)
 {
   /* -mkernel implies -fapple-kext for C++ */
@@ -2969,7 +2935,10 @@ darwin_function_section (tree decl, enum node_freq
   bool startup, bool exit)
 {
   if (!flag_reorder_functions)
-return NULL;
+return (DECL_WEAK (decl)
+? darwin_sections[text_coal_section]
+: text_section);
+
   /* Startup code should go to startup subsection unless it is
  unlikely executed (this happens especially with function splitting
  where we can split away unnecesary parts of static constructors.  */
@@ -2994,7 +2963,9 @@ darwin_function_section (tree decl, enum node_freq
 return get_named_text_section
  (decl, "__TEXT,__hot,regular,pure_instructions", "_hot");
   default:
-return NULL;
+return (DECL_WEAK (decl)
+? darwin_sections[text_coal_section]
+: text_section);
 }
 }

Index: gcc/config/darwin.h
===
--- gcc/config/darwin.h(revision 167793)
+++ gcc/config/darwin.h(working copy)
@@ -664,7 +664,7 @@ extern GTY(()) section * darwin_sections[NUM_DARWI

 #undefTARGET_ASM_SELECT_SECTION
 #define TARGET_ASM_SELECT_SECTION machopic_select_section
-#define USE_SELECT_SECTION_FOR_FUNCTIONS
+
 #undefTARGET_ASM_FUNCTION_SECTION
 #define TARGET_ASM_FUNCTION_SECTION darwin_function_section


[Bug tree-optimization/45552] [graphite] ICE in sese_loop_depth, at sese.h:172

2010-12-14 Thread spop at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45552

Sebastian Pop  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2010.12.14 17:17:49
 AssignedTo|unassigned at gcc dot   |spop at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #2 from Sebastian Pop  2010-12-14 17:17:49 
UTC ---
Mine.
I can see this ICE on the 4.5 branch.
On trunk this has been fixed.


[Bug tree-optimization/45552] [graphite] ICE in sese_loop_depth, at sese.h:172

2010-12-14 Thread spop at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45552

--- Comment #3 from Sebastian Pop  2010-12-14 17:24:39 
UTC ---
I can see a different error than what reported:
glcells.c:846:12: internal compiler error: in chrec_component_in_loop_num, at
tree-chrec.c:758

I'm reducing the testcase using delta.


[Bug target/46942] x86_64 parameter passing unnecessary sign/zero extends

2010-12-14 Thread joseph at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942

--- Comment #2 from joseph at codesourcery dot com  2010-12-14 17:26:11 UTC ---
If the conclusion is that the callee can rely on the caller having done 
the extension then you need to watch out for security issues in the kernel 
syscall ABI when building with a compiler that generates code relying on 
this.

http://lkml.org/lkml/2007/6/4/376
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0029

If there were target-specific aspects to the fix to that security issue, 
they may not have included x86_64 changes.


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #33 from Jan Hubicka  2010-12-14 17:32:16 
UTC ---
> minor update (this removes a test for reorder & partition + exceptions that is
> carried out too early)
This seem sane to me.  I've also posted more fixed to function partitioning
that
should handle named functions and other side cases.

Thanks for looking into this,
Honza


[Bug ada/46943] New: Unnecessary ZERO_EXTEND

2010-12-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46943

   Summary: Unnecessary ZERO_EXTEND
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: ada
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ja...@gcc.gnu.org
Target: x86_64-linux


In http://blog.regehr.org/archives/320 Example 4
unsigned long long v;
unsigned short
foo (signed char x, unsigned short y)
{
  v = (unsigned long long) y;
  return (unsigned short) ((int) y / 3);
}
we emit a redundant zero-extension:
movzwl  %si, %eax
movq%rax, v(%rip)
movzwl  %si, %eax
imull   $43691, %eax, %eax
shrl$17, %eax
ret
The reason why the second movzwl %si, %eax wasn't CSEd with the first one is
because the first one is (set (reg:DI reg1) (zero_extend:DI (reg:HI reg2))
while the second one is (set (reg:SI reg3) (zero_extend:SI (reg:HI reg2))
Wonder if we can't teach CSE to optimize it (say that reg3 is actually
(subreg:SI (reg:DI reg1) 0), or if e.g. one of the zee/see passes (implicit-zee
e.g.) couldn't handle such cases.  Combiner can't do anything here, as there is
no data dependency, so try_combine won't see them together.


[Bug tree-optimization/45791] Missed devirtualization

2010-12-14 Thread jamborm at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45791

Martin Jambor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2010.12.14 17:45:52
 Ever Confirmed|0   |1

--- Comment #8 from Martin Jambor  2010-12-14 
17:45:52 UTC ---
I've just confirmed that main of the testcase from the initial bug
description is optimized to nothing even by just the early optimizers
on trunk.  My dynamic-type change detection patches postpone that a
little bit, unfortunately (and inevitably) but the final result is the
same.  I believe we have testcases already for this.

As far as the testcase from comment #5 is concerned, that is quite
another matter because the object is dynamically allocated there.  If
the constructor is inlined, we may do this with improved folding of
O_T_R according to its first parameter.  If it is not, we would need
to be able to track the object interprocedurally to verify nothing bad
happens to it (like a call to a destructor followed by a call to
placement new).  And of course we would have to solve the "operator
new is not malloc" problem.


[Bug fortran/46849] [OOP] MODULE PROCEDURE resolution does not work in BLOCK or SELECT TYPE

2010-12-14 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46849

--- Comment #7 from janus at gcc dot gnu.org 2010-12-14 18:30:48 UTC ---
(In reply to comment #6)
> I agree that this is better, though it still causes some regressions. I will
> now test the following variant:
> 
> Index: gcc/fortran/resolve.c
> ===
> --- gcc/fortran/resolve.c   (revision 167790)
> +++ gcc/fortran/resolve.c   (working copy)
> @@ -11784,7 +11784,7 @@ resolve_symbol (gfc_symbol *sym)
>for (ns = gfc_current_ns->parent; ns; ns = ns->parent)
> {
>   symtree = gfc_find_symtree (ns->sym_root, sym->name);
> - if (symtree && symtree->n.sym->generic)
> + if (symtree && symtree->n.sym->attr.flavor == FL_PROCEDURE)
> {
>   this_symtree = gfc_find_symtree (gfc_current_ns->sym_root,
>sym->name);


Unfortunately this also triggers a few regressions, but the following regtests
cleanly:

Index: gcc/fortran/resolve.c
===
--- gcc/fortran/resolve.c   (revision 167790)
+++ gcc/fortran/resolve.c   (working copy)
@@ -11784,7 +11784,9 @@ resolve_symbol (gfc_symbol *sym)
   for (ns = gfc_current_ns->parent; ns; ns = ns->parent)
{
  symtree = gfc_find_symtree (ns->sym_root, sym->name);
- if (symtree && symtree->n.sym->generic)
+ if (symtree && (symtree->n.sym->generic ||
+ (symtree->n.sym->attr.flavor == FL_PROCEDURE
+  && sym->ns->construct_entities)))
{
  this_symtree = gfc_find_symtree (gfc_current_ns->sym_root,
   sym->name);


[Bug libstdc++/44952] #include implies global constructor.

2010-12-14 Thread ccoutant at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44952

Cary Coutant  changed:

   What|Removed |Added

 CC||ccoutant at gcc dot gnu.org

--- Comment #15 from Cary Coutant  2010-12-14 
18:50:11 UTC ---
(In reply to comment #13)
> So reopening for this enhancement...
> 
> Another alternative would be some .init.first array or something similar which
> would contain pointers to functions to be run as early constructors and linker
> would remove duplicates in it and put it at the beginning of .init_array
> section.

For ELF targets, this is what DT_PREINIT_ARRAY is for.

http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#init_fini

-cary


[Bug middle-end/46916] gcc.dg/torture/stackalign/non-local-goto-[1,2].c ICEs compiler due to r167727

2010-12-14 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46916

--- Comment #34 from Dominique d'Humieres  
2010-12-14 19:00:43 UTC ---
If I did not make any mistake, the updated patch in comment #32 does not fix
the failures in comments #29 and #31.


  1   2   >