[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #19 from Uros Bizjak  2011-08-03 06:47:30 
UTC ---
Paolo,

FYI, problem in comment #11 can be seen on unpatched trunk by compiling the
testcase from comment #5.


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #18 from Uros Bizjak  2011-08-03 06:40:45 
UTC ---
(In reply to comment #17)
> H.J., I agree with what you write in comment 16.  But unless we are sure that
> the problematic composition will never be generated (e.g. by ivopts), we 
> cannot
> afford that.
> 
> The patch in comment 7 may have some snafu, but overall it looks very sane. 
> It's just that a const is not being stripped.  Can it be applied on top of the
> x32 branch?  Or do I first have to revert some earlier revision?

The patch can be applied to current trunk as-is and all the problems discussed
here will be shown by simply compiling with -mx32.


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread bonzini at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #17 from Paolo Bonzini  2011-08-03 06:32:42 
UTC ---
H.J., I agree with what you write in comment 16.  But unless we are sure that
the problematic composition will never be generated (e.g. by ivopts), we cannot
afford that.

The patch in comment 7 may have some snafu, but overall it looks very sane. 
It's just that a const is not being stripped.  Can it be applied on top of the
x32 branch?  Or do I first have to revert some earlier revision?


[Bug libstdc++/49953] _toupper() and _tolower() macros in ctype.h are broken

2011-08-02 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49953

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID

--- Comment #1 from Andrew Pinski  2011-08-03 
05:42:28 UTC ---
_tolower and _toupper are internal macros to ctype.h and should not be used
directly.  Also GCC does not include a ctype.h rather it comes from the libc
you are using (most likely glibc or newlib).


[Bug libstdc++/49953] New: _toupper() and _tolower() macros in ctype.h are broken

2011-08-02 Thread jmichae3 at yahoo dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49953

   Summary: _toupper() and _tolower() macros in ctype.h are broken
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: jmich...@yahoo.com


not sure if I categorized this correctly.
in ctype.h I found
#define _tolower(_Char) ((_Char)-'A'+'a')
#define _toupper(_Char) ((_Char)-'a'+'A')

this code is broken when it is used in the situations where the character is
already in the desired case.  then you get garbage characters.
try it yourself.
example: _tolower('a') produces garbage.


#include 
#include 
int main(void) {
printf("%c%c", _toupper('A'),_tolower('a')); 
//result is !ü which is not proper
return 0;
}

a proper bug fix would be

#define _tolower(_Char) ((_Char>='A'&&_Char<='Z')?_Char+('a'-'A'):_Char)
#define _toupper(_Char) ((_Char>='a'&&_Char<='z')?_Char-('a'-'A'):_Char)


//#include 
#include 
#define _tolower(_Char) ((_Char>='A'&&_Char<='Z')?_Char+('a'-'A'):_Char)
#define _toupper(_Char) ((_Char>='a'&&_Char<='z')?_Char-('a'-'A'):_Char)
int main(void) {
printf("%c%c%c%c", _toupper('A'),_toupper('a'),
_tolower('A'),_tolower('a'));
//result is AAaa
return 0;
}


[Bug rtl-optimization/49941] [4.7 Regression] segmentation fault in redirect_jump_2

2011-08-02 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49941

--- Comment #7 from Alan Modra  2011-08-03 03:07:13 
UTC ---
The lurking problem being that copy_rtx_if_shared_1 needs to leave RETURN
shared, and I guess mark_used_flags doesn't need to do anything with RETURN
too.


[Bug rtl-optimization/49941] [4.7 Regression] segmentation fault in redirect_jump_2

2011-08-02 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49941

--- Comment #6 from Alan Modra  2011-08-03 02:43:18 
UTC ---
Bernd, with your patch applied, bootstrap dies here:

In file included from
/home/amodra/src/gcc-virgin/libgcc/../libdecnumber/decQuad.c:140:0:
/home/amodra/src/gcc-virgin/libgcc/../libdecnumber/decBasic.c: In function
'decNumCompare':
/home/amodra/src/gcc-virgin/libgcc/../libdecnumber/decBasic.c:3773:3: internal
compiler error: Segmentation fault

(gdb) bt
#0  active_insn_p (insn=0x1b) at
/home/amodra/src/gcc-virgin/gcc/emit-rtl.c:3258
#1  0x1026b114 in next_active_insn (insn=0x1b) at
/home/amodra/src/gcc-virgin/gcc/emit-rtl.c:3271
#2  0x104e3ba4 in tablejump_p (insn=, labelp=0x0,
tablep=0x10dd9ca8) at /home/amodra/src/gcc-virgin/gcc/rtlanal.c:2667
#3  0x1022bb5c in scan_trace (trace=) at
/home/amodra/src/gcc-virgin/gcc/dwarf2cfi.c:2586
#4  0x1022c374 in create_cfi_notes () at
/home/amodra/src/gcc-virgin/gcc/dwarf2cfi.c:2621
#5  execute_dwarf2_frame () at /home/amodra/src/gcc-virgin/gcc/dwarf2cfi.c:2953

(gdb) p debug_rtx(insn)
(jump_insn 1695 1694 1698 (parallel [
(return)
(use (reg:DI 65 lr))
]) /home/amodra/src/gcc-virgin/libgcc/../libdecnumber/decBasic.c:3773
708 {*return_internal_di}
 (nil)
 -> return)
$4 = void
(gdb) p default_target_rtl.x_global_rtl[2]
$5 = (rtx) 0xf70200c0
(gdb) down
#2  0x104e3ba4 in tablejump_p (insn=, labelp=0x0,
tablep=0x10dd9ca8) at /home/amodra/src/gcc-virgin/gcc/rtlanal.c:2667
(gdb) p label
$6 = (struct rtx_def *) 0xf7029f40
(gdb) p debug_rtx(label)
(return)
$7 = void
(gdb) p debug_rtx(default_target_rtl.x_global_rtl[2])
(return)
$8 = void
(gdb) 

So it appears we have another problem lurking here.


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #16 from H.J. Lu  2011-08-03 02:40:05 
UTC ---
The fundamental question is what the actual address for
(symbol FOO + const_int Y), where the numerical value of
(symbol FOO + const_int Y) is outside of [0 - (2 to the power
of hardware address bits) - 1], should be. I believe the
answer should be "implementation defined" and programs which
depend on certain behavior are broken.


[Bug rtl-optimization/49941] [4.7 Regression] segmentation fault in redirect_jump_2

2011-08-02 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49941

--- Comment #5 from Alan Modra  2011-08-03 01:29:54 
UTC ---
Bernd, that looks very similar to the patch I started to write.  Then I saw the
comment in mark_jump_label_1
/* Do not change a previous setting of JUMP_LABEL.  If the
   JUMP_LABEL slot is occupied by a different label,
   create a note for this label.  */

So I'm a little concerned that plugging in ret_rtx like that is safe.  Hmm, I
suppose it is if you know for sure that any jump that returns doesn't reference
other labels.  Is that the case?

I have a patch that handles the JUMP_LABEL replacement in rs6000.md


[Bug c++/49593] [C++0x] cannot use T{t}... as pack expansion

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49593

--- Comment #2 from Jason Merrill  2011-08-03 
01:25:40 UTC ---
Author: jason
Date: Wed Aug  3 01:25:37 2011
New Revision: 177227

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177227
Log:
PR c++/49593
* pt.c (find_parameter_packs_r): Handle CONSTRUCTOR.

Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/variadic115.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/pt.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug c++/49803] [C++0x] erroneous variant-member initialization in a union containing an anonymous struct

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49803

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.6.2

--- Comment #5 from Jason Merrill  2011-08-03 
01:27:05 UTC ---
Fixed for 4.6.2.


[Bug c++/49803] [C++0x] erroneous variant-member initialization in a union containing an anonymous struct

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49803

--- Comment #4 from Jason Merrill  2011-08-03 
01:25:28 UTC ---
Author: jason
Date: Wed Aug  3 01:25:25 2011
New Revision: 177226

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177226
Log:
PR c++/49803
* init.c (sort_mem_initializers): Initialize uses_unions_p here.
(build_field_list): Not here.

Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/union5.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/init.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug c++/49593] [C++0x] cannot use T{t}... as pack expansion

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49593

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.6.2

--- Comment #3 from Jason Merrill  2011-08-03 
01:27:41 UTC ---
Fixed for 4.6.2.


[Bug c++/43886] [C++0x] name lookup failure on un-used local variable in lambda compound-statement

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43886

Jason Merrill  changed:

   What|Removed |Added

   Target Milestone|4.7.0   |4.6.2

--- Comment #5 from Jason Merrill  2011-08-03 
01:26:18 UTC ---
Fixed for 4.6.2 as well.


[Bug c++/43886] [C++0x] name lookup failure on un-used local variable in lambda compound-statement

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43886

--- Comment #4 from Jason Merrill  2011-08-03 
01:25:47 UTC ---
Author: jason
Date: Wed Aug  3 01:25:44 2011
New Revision: 177228

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177228
Log:
PR c++/43886
* parser.c (cp_parser_lambda_body): Clear local_variables_forbidden_p.

Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg2.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/parser.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug target/49437] interrupt return pop sometimes corrupts sp

2011-08-02 Thread joey.ye at arm dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49437

Joey Ye  changed:

   What|Removed |Added

 CC||joey.ye at arm dot com

--- Comment #2 from Joey Ye  2011-08-03 00:47:10 UTC ---
A patch and test case is available at
http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00244.html


[Bug rtl-optimization/49941] [4.7 Regression] segmentation fault in redirect_jump_2

2011-08-02 Thread bernds at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49941

--- Comment #3 from Bernd Schmidt  2011-08-03 
00:04:55 UTC ---
Created attachment 24898
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24898
Test patch

Please try this. If it doesn't work, please attach a preprocessed testcase.


[Bug rtl-optimization/49941] [4.7 Regression] segmentation fault in redirect_jump_2

2011-08-02 Thread bernds at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49941

Bernd Schmidt  changed:

   What|Removed |Added

 CC||bernds at gcc dot gnu.org

--- Comment #4 from Bernd Schmidt  2011-08-03 
00:05:22 UTC ---
Sorry, wrong version - remove the SIMPLE_RETURN case.


[Bug rtl-optimization/48596] [4.7 Regression] [SH] unable to find a register to spill in class 'FPUL_REGS'

2011-08-02 Thread kkojima at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48596

--- Comment #5 from Kazumoto Kojima  2011-08-02 
23:53:30 UTC ---
I was trying to find a way that solves it without penalizing -O2
or the higher cases, though it's not easy to me.  It seems that
the target's register_move_cost is the way to discourage trying
to use FP registers for a pointer.  Unfortunately, Pmode is simply
SImode for our case and it also discourages using a FP reg as
a cheap storage for SImode.  I've tried

--- ORIG/trunk/gcc/config/sh/sh.c2011-08-01 09:22:27.0 +0900
+++ trunk/gcc/config/sh/sh.c2011-08-01 09:41:25.0 +0900
@@ -11472,8 +11472,18 @@ sh_register_move_cost (enum machine_mode
&& REGCLASS_HAS_GENERAL_REG (srcclass))
   || (REGCLASS_HAS_GENERAL_REG (dstclass)
   && REGCLASS_HAS_FP_REG (srcclass)))
-return ((TARGET_SHMEDIA ? 4 : TARGET_FMOVD ? 8 : 12)
-* ((GET_MODE_SIZE (mode) + 7) / 8U));
+{
+  if (TARGET_SHMEDIA)
+return 4 * ((GET_MODE_SIZE (mode) + 7) / 8U);
+  else
+{
+  /* Discourage trying to use fp regs for a pointer.  */
+  int addend = (mode == Pmode) ? 40 : 0;
+
+  return (((TARGET_FMOVD ? 8 : 12) + addend)
+  * ((GET_MODE_SIZE (mode) + 7) / 8U));
+}
+}

   if ((dstclass == FPUL_REGS
&& REGCLASS_HAS_GENERAL_REG (srcclass))

on the current trunk and observed some CSiBE testresults.  A bit
surprisingly, there are no code size regressions and one 2%
improvement for teem-1.6.0-src src/bane/gkmsTxf which reduces
to 3192 bytes from 3256 bytes.  Now I'm inclined to apply it
on trunk if it passes the bootstrap/regression/other tests.


[Bug target/49688] [alpha]: Many execution test failures

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49688

Richard Henderson  changed:

   What|Removed |Added

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

--- Comment #17 from Richard Henderson  2011-08-02 
23:40:22 UTC ---
Mine.


[Bug libgcj/40947] Invalid flag usage: Wl,-rpath, -Wx,-option must appear after -_SYSTYPE_SVR4

2011-08-02 Thread htl10 at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40947

--- Comment #14 from Hin-Tak Leung  
2011-08-02 23:31:30 UTC ---
(In reply to comment #13)
> One other possible problem: please avoid relative pathnames to configure and
> an object directory that is a subdir of the source tree.  Better do (say)
> 
> mkdir /vol/gcc/obj/gcc-4.6.1
> cd /vol/gcc/obj/gcc-4.6.1
> /vol/gcc/src/gcc-4.6.1/configure 

Tried specifying full path instead of relative path in configure. Still exactly
the same problem. With 4.6.1 (source is untar'ed to
/home/htl10/tmp-build/gcc-4.4.6):

cd /home/htl10/tmp-build/
mkdir gcc-446-obj
cd gcc-446-obj
/home/htl10/tmp-build/gcc-4.4.6/configure
make

last part of output:
---
libtool: link: /home/htl10/tmp-build/gcc-446-obj/gcc/gcj
-B/home/htl10/tmp-build/gcc-446-obj/alphaev68-dec-osf5.1a/libjava/
-B/home/htl10/tmp-build/gcc-446-obj/gcc/ -mieee -g -O2 -o .libs/jv-convert
--main=gnu.gcj.convert.Convert -shared-libgcc 
-L/home/htl10/tmp-build/gcc-446-obj/alphaev68-dec-osf5.1a/libjava/.libs
-L/home/htl10/tmp-build/gcc-446-obj/alphaev68-dec-osf5.1a/libjava
./.libs/libgcj.so -lpthread -lrt -Wl,-rpath -Wl,/usr/local/lib
/bin/ld:
Invalid flag usage: Wl,-rpath, -Wx,-option must appear after -_SYSTYPE_SVR4 
/bin/ld: Usage: /bin/ld [options] file [...]
collect2: ld returned 1 exit status
make[3]: *** [jv-convert] Error 1
make[3]: Leaving directory
`/home/htl10/tmp-build/gcc-446-obj/alphaev68-dec-osf5.1a/libjava'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/home/htl10/tmp-build/gcc-446-obj/alphaev68-dec-osf5.1a/libjava'
make[1]: *** [all-target-libjava] Error 2
make[1]: Leaving directory `/home/htl10/tmp-build/gcc-446-obj'
make: *** [all] Error 2
bash-2.05a# 



[Bug target/49878] [h8300] ICE in based_loc_descr, at dwarf2out.c:10478

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49878

Richard Henderson  changed:

   What|Removed |Added

   Target Milestone|--- |4.7.0


[Bug target/49874] [4.5/4.6][h8300] ICE in compute_frame_pointer_to_fb_displacement, at dwarf2out.c:16312

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49874

Richard Henderson  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.08.02 23:07:47
 Ever Confirmed|0   |1


[Bug target/49874] [4.5/4.6][h8300] ICE in compute_frame_pointer_to_fb_displacement, at dwarf2out.c:16312

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49874

Richard Henderson  changed:

   What|Removed |Added

  Known to work||4.7.0
   Target Milestone|--- |4.7.0
Summary|[h8300] ICE in  |[4.5/4.6][h8300] ICE in
   |compute_frame_pointer_to_fb |compute_frame_pointer_to_fb
   |_displacement, at   |_displacement, at
   |dwarf2out.c:16312   |dwarf2out.c:16312
  Known to fail||4.5.5, 4.6.2

--- Comment #3 from Richard Henderson  2011-08-02 
23:07:23 UTC ---
Fixed in mainline, almost certainly a duplicate of PR49878.
The fix for that isn't too invasive if an interested party
wanted to backport to an open release branch.


[Bug c++/49952] [C++0x] Unicode literals do not generate errors as prescribed by the FDIS standard

2011-08-02 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49952

Paolo Carlini  changed:

   What|Removed |Added

 CC||kris.van.hees at oracle dot
   ||com

--- Comment #1 from Paolo Carlini  2011-08-02 
22:32:10 UTC ---
Kris, are you willing to triage this PR?


[Bug target/49879] [h8300] ICE in maybe_record_trace_start, at dwarf2cfi.c:2439

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49879

Richard Henderson  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #6 from Richard Henderson  2011-08-02 
22:20:26 UTC ---
Fixed.


[Bug target/49881] [AVR] Inefficient stack manipulation around calls

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49881

Richard Henderson  changed:

   What|Removed |Added

   Target Milestone|--- |4.7.0


[Bug target/49881] [AVR] Inefficient stack manipulation around calls

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49881

Richard Henderson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #10 from Richard Henderson  2011-08-02 
22:22:10 UTC ---
I think we can consider this fixed.
Certainly we're doing much better for this specific case.


[Bug debug/49864] ICE: in maybe_record_trace_start, at dwarf2cfi.c:2439

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49864

Richard Henderson  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #6 from Richard Henderson  2011-08-02 
22:19:05 UTC ---
Fixed.


[Bug debug/49864] ICE: in maybe_record_trace_start, at dwarf2cfi.c:2439

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49864

--- Comment #5 from Richard Henderson  2011-08-02 
22:18:38 UTC ---
Author: rth
Date: Tue Aug  2 22:18:35 2011
New Revision: 177218

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177218
Log:
PR target/49864
* reg-notes.def (REG_ARGS_SIZE): New.
* calls.c (emit_call_1): Emit REG_ARGS_SIZE for call_pop.
(expand_call): Add REG_ARGS_SIZE to emit_stack_restore.
* cfgcleanup.c (old_insns_match_p): Don't allow cross-jumping to
different stack levels.
* combine-stack-adj.c (adjust_frame_related_expr): Remove.
(maybe_move_args_size_note): New.
(combine_stack_adjustments_for_block): Use it.
* combine.c (distribute_notes): Place REG_ARGS_SIZE.
* dwarf2cfi.c (dw_cfi_row_struct): Remove args_size member.
(dw_trace_info): Add beg_true_args_size, end_true_args_size,
beg_delay_args_size, end_delay_args_size, eh_head, args_size_undefined.
(cur_cfa): New.
(queued_args_size): Remove.
(add_cfi_args_size): Assert size is non-negative.
(stack_adjust_offset, dwarf2out_args_size): Remove.
(dwarf2out_stack_adjust, dwarf2out_notice_stack_adjust): Remove.
(notice_args_size, notice_eh_throw): New.
(dwarf2out_frame_debug_def_cfa): Use cur_cfa.
(dwarf2out_frame_debug_adjust_cfa): Likewise.
(dwarf2out_frame_debug_cfa_offset): Likewise.
(dwarf2out_frame_debug_expr): Likewise.  Don't stack_adjust_offset.
(dwarf2out_frame_debug): Don't handle non-frame-related-p insns.
(change_cfi_row): Don't emit args_size.
(maybe_record_trace_start_abnormal): Split out from ...
(maybe_record_trace_start): Here.  Set args_size_undefined.
(create_trace_edges): Update to match.
(scan_trace): Handle REG_ARGS_SIZE.
(connect_traces): Connect args_size between EH insns.
* emit-rtl.c (try_split): Handle REG_ARGS_SIZE.
* explow.c (suppress_reg_args_size): New.
(adjust_stack_1): Split out from ...
(adjust_stack): ... here.
(anti_adjust_stack): Use it.
(allocate_dynamic_stack_space): Suppress REG_ARGS_SIZE.
* expr.c (mem_autoinc_base): New.
(fixup_args_size_notes): New.
(emit_single_push_insn_1): Rename from emit_single_push_insn.
(emit_single_push_insn): New.  Generate REG_ARGS_SIZE.
* recog.c (peep2_attempt): Handle REG_ARGS_SIZE.
* reload1.c (reload_as_needed): Likewise.
* rtl.h (fixup_args_size_notes): Declare.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/calls.c
trunk/gcc/cfgcleanup.c
trunk/gcc/combine-stack-adj.c
trunk/gcc/combine.c
trunk/gcc/dwarf2cfi.c
trunk/gcc/emit-rtl.c
trunk/gcc/explow.c
trunk/gcc/expr.c
trunk/gcc/recog.c
trunk/gcc/reg-notes.def
trunk/gcc/reload1.c
trunk/gcc/rtl.h


[Bug c++/49952] New: Unicode literals do not generate errors as prescribed by the FDIS standard

2011-08-02 Thread z0sh at sogetthis dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49952

   Summary: Unicode literals do not generate errors as prescribed
by the FDIS standard
   Product: gcc
   Version: 4.6.1
Status: UNCONFIRMED
  Severity: trivial
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: z...@sogetthis.com
  Host: Linux x86


Referring to the standard:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm

The character literal \U must only accept characters in the range
0-0x10, excluding surrogates. However, GCC allows 31-bit values above
0x10. To wit, the following compiles:

char32_t s[] = U"\U0010\U7FFF";

It may be that the actual wording of the FDIS (2.3.2, p.19) is more relaxed
than in the reference I gave above and that this behaviour is in fact
intentional, but I thought I bring it up anyway.


[Bug c++/49577] [C++0x] narrowing conversion not rejected

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49577

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #5 from Jason Merrill  2011-08-02 
21:33:02 UTC ---
Fixed for 4.7.


[Bug c++/43886] [C++0x] name lookup failure on un-used local variable in lambda compound-statement

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43886

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #3 from Jason Merrill  2011-08-02 
21:32:34 UTC ---
Fixed for 4.7.


[Bug target/34888] Stack patterns for AVR not optimal

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34888

--- Comment #4 from Richard Henderson  2011-08-02 
21:10:51 UTC ---
Created attachment 24897
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24897
Optimize pop-all

The proposed patch for PR49864 introduces REG_ARGS_SIZE.
This records a (normally) non-negative number of bytes
that have been pushed for arguments.

Post-reload, if we see a (mov sp reg) insn that says that
it's resetting the stack height, under a (common) set of
conditions we can transform that to (mov sp fp) and let
the previous (mov reg sp) (add reg N) insns be deleted as
dead code.

This reduces that common case to 4 insns instead of 9.


[Bug c++/49593] [C++0x] cannot use T{t}... as pack expansion

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49593

--- Comment #1 from Jason Merrill  2011-08-02 
21:09:13 UTC ---
Author: jason
Date: Tue Aug  2 21:09:08 2011
New Revision: 177214

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177214
Log:
PR c++/49593
* pt.c (find_parameter_packs_r): Handle CONSTRUCTOR.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic115.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/49577] [C++0x] narrowing conversion not rejected

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49577

--- Comment #4 from Jason Merrill  2011-08-02 
21:09:20 UTC ---
Author: jason
Date: Tue Aug  2 21:09:17 2011
New Revision: 177215

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177215
Log:
PR c++/49577
* typeck2.c (check_narrowing): Check unsigned mismatch.
* semantics.c (finish_compound_literal): check_narrowing.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/semantics.c
trunk/gcc/cp/typeck2.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/initlist5.C
trunk/gcc/testsuite/g++.dg/opt/range-test-1.C


[Bug c++/43886] [C++0x] name lookup failure on un-used local variable in lambda compound-statement

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43886

--- Comment #2 from Jason Merrill  2011-08-02 
21:09:31 UTC ---
Author: jason
Date: Tue Aug  2 21:09:26 2011
New Revision: 177216

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177216
Log:
PR c++/43886
* parser.c (cp_parser_lambda_body): Clear local_variables_forbidden_p.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/49803] [C++0x] erroneous variant-member initialization in a union containing an anonymous struct

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49803

--- Comment #3 from Jason Merrill  2011-08-02 
21:09:02 UTC ---
Author: jason
Date: Tue Aug  2 21:08:57 2011
New Revision: 177213

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177213
Log:
PR c++/49803
* init.c (sort_mem_initializers): Initialize uses_unions_p here.
(build_field_list): Not here.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/union5.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/init.c
trunk/gcc/testsuite/ChangeLog


[Bug target/34888] Stack patterns for AVR not optimal

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34888

Richard Henderson  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||rth at gcc dot gnu.org
 Depends on||49864
 AssignedTo|unassigned at gcc dot   |rth at gcc dot gnu.org
   |gnu.org |

--- Comment #3 from Richard Henderson  2011-08-02 
21:04:52 UTC ---
(1) was fixed at r171295.
(2) is done.
(3) is done.
(4) is hopefully mostly irrelevant now, or shortly post PR49864.

As of r177196 (PR49881), we should be generating many more PUSH
insns than before, and queueing more stack space to be popped
all at once.  For the testcase mentioned in that PR, we seem to
wait for ~40 bytes to get pushed, and pop them all at once.


[Bug c++/32997] duplicate nested type error has disappeared

2011-08-02 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32997

Paolo Carlini  changed:

   What|Removed |Added

 CC||dodji at gcc dot gnu.org

--- Comment #3 from Paolo Carlini  2011-08-02 
20:54:14 UTC ---
Maybe Dodji is interested...


[Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

Richard Henderson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #11 from Richard Henderson  2011-08-02 
20:49:40 UTC ---
Fixed for 4.7.  Will not be backported to earlier branches.


[Bug debug/47597] ICE: call frame debugging information is not handled when case is post_dec

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47597

Richard Henderson  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||rth at gcc dot gnu.org
Version|4.4.3   |4.7.0
 Resolution||FIXED

--- Comment #3 from Richard Henderson  2011-08-02 
20:44:41 UTC ---
Fixed for 4.7.  This won't be backported to the 4.4 branch.


[Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section

2011-08-02 Thread Torleif.Sandnes at atmel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

--- Comment #10 from Torleif.Sandnes at atmel dot com 2011-08-02 20:46:09 UTC 
---
I am on vacation, but will be back 8th August.

Torleif Sandnes


[Bug target/49878] [h8300] ICE in based_loc_descr, at dwarf2out.c:10478

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49878

Richard Henderson  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #5 from Richard Henderson  2011-08-02 
20:39:18 UTC ---
Fixed.


[Bug bootstrap/49914] call to abs(long long) in gcc/fold-const.c

2011-08-02 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49914

Paolo Carlini  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #11 from Paolo Carlini  2011-08-02 
20:31:09 UTC ---
Fixed. I hope it helps a little bit also the __cplusplus issue...


[Bug ada/49084] [4.7 regression] bootstrap failure with Ada enabled

2011-08-02 Thread anhvofrcaus at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49084

--- Comment #5 from Anh Vo  2011-08-02 20:28:03 
UTC ---
On Tue, Aug 2, 2011 at 8:41 AM, anhvofrcaus at gmail dot com
 wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49084
>
> --- Comment #4 from Anh Vo  2011-08-02 15:40:34 
> UTC ---
> On Tue, Aug 2, 2011 at 7:18 AM, rguenth at gcc dot gnu.org
>  wrote:
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49084
>>
>> --- Comment #3 from Richard Guenther  2011-08-02 
>> 14:12:01 UTC ---
>> Does it work now?
>
> It still fails with snapshot gcc-4.7-20110716. I am downloading
> gcc-4.7-20110730 at this minute. I will report the result of it once
> the build is complete.

It fails once again. However, it fails at different point (in stage 2)
and with different error message compared to the past failure. Below
is the error message:

[...]
/c/Gcc/Build-4.7.x/./prev-gcc/g++ -B/c/Gcc/Build-4.7.x/./prev-gcc/
-B/usr/local/i686-pc-mingw32/bin/ -nostdinc++
-B/c/Gcc/Build-4.7.x/prev-i686-pc-mingw32/libstdc++-v3/src/.libs
-B/c/Gcc/Build-4.7.x/prev-i686-pc-mingw32/libstdc++-v3/libsupc++/.libs
-I/c/Gcc/Build-4.7.x/prev-i686-pc-mingw32/libstdc++-v3/include/i686-pc-
mingw32 -I/c/Gcc/Build-4.7.x/prev-i686-pc-mingw32/libstdc++-v3/include
-I/c/Gcc/gcc-4.7-20110730/libstdc++-v3/libsupc++
-L/c/Gcc/Build-4.7.x/prev-i686-pc-mingw32/libstdc++-v3/src/.libs
-L/c/Gcc/Build-4.7.x/prev-i686-pc-mingw32/libstdc++-v3/libsupc++/.libs
-c  -g -O2 -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format -DIN_GCC
   -W -Wall -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-fno-common -Wno-error -DHAVE_CONFIG_H -I. -Iada
-I../../gcc-4.7-20110730/gcc -I../../gcc-4.7-20110730/gcc/ada
-I../../gcc-4.7-20110730/gcc/../include -I./../intl
-I../../gcc-4.7-20110730/gcc/../libcpp/include
-I../../gcc-4.7-20110730/gcc/../libdecnumber
-I../../gcc-4.7-20110730/gcc/../libdecnumber/bid -I../libdecnumber
../../gcc-4.7-20110730/gcc/ada/adaint.c -o ada/adaint.o
../../gcc-4.7-20110730/gcc/ada/adaint.c: In function 'OS_Time
__gnat_file_time_n
ame_attr(char*, file_attributes*)':
../../gcc-4.7-20110730/gcc/ada/adaint.c:1373:73: warning: suggest parentheses
ar
ound assignment used as truth value [-Wparentheses]
../../gcc-4.7-20110730/gcc/ada/adaint.c: In function 'void
__gnat_set_OWNER_ACL(
TCHAR*, DWORD, DWORD)':
../../gcc-4.7-20110730/gcc/ada/adaint.c:2004:66: error: invalid conversion from
'DWORD {aka long unsigned int}' to 'ACCESS_MODE {aka _ACCESS_MODE}'
[-fpermissive]
/mingw/include/aclapi.h:15:23: error:   initializing argument 4 of
'void BuildExplicitAccessWithNameW(PEXPLICIT_ACCESS_W, LPWSTR, DWORD,
ACCESS_MODE, DWORD)' [-fpermissive]
../../gcc-4.7-20110730/gcc/ada/adaint.c: At global scope:
../../gcc-4.7-20110730/gcc/ada/adaint.c:2263:1: warning: unused
parameter 'name' [-Wunused-parameter]
../../gcc-4.7-20110730/gcc/ada/adaint.c: In function 'void
add_handle(HANDLE, int)':
../../gcc-4.7-20110730/gcc/ada/adaint.c:2461:67: error: invalid
conversion from'void*' to 'void**' [-fpermissive]
../../gcc-4.7-20110730/gcc/ada/adaint.c:2463:60: error: invalid conversion from
'void*' to 'int*' [-fpermissive]
../../gcc-4.7-20110730/gcc/ada/adaint.c: In function 'char*
__gnat_locate_exec_on_path(char*)':
../../gcc-4.7-20110730/gcc/ada/adaint.c:2833:16: error: invalid
conversion from'void*' to 'TCHAR* {aka wchar_t*}' [-fpermissive]
../../gcc-4.7-20110730/gcc/ada/adaint.c:2843:15: error: invalid
conversion from'void*' to 'char*' [-fpermissive]
make[3]: *** [ada/adaint.o] Error 1
make[3]: Leaving directory `/c/Gcc/Build-4.7.x/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/c/Gcc/Build-4.7.x'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/c/Gcc/Build-4.7.x'
make: *** [all] Error 2


[Bug bootstrap/49914] call to abs(long long) in gcc/fold-const.c

2011-08-02 Thread paolo at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49914

--- Comment #10 from paolo at gcc dot gnu.org  
2011-08-02 20:27:00 UTC ---
Author: paolo
Date: Tue Aug  2 20:26:57 2011
New Revision: 177212

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177212
Log:
2011-08-02  Paolo Carlini  

PR bootstrap/49914
* fold-const.c (fold_plusminus_mult_expr): Use abs_hwi instead
of abs.
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Likewise.
* tree-ssa-loop-prefetch.c (prune_ref_by_group_reuse): Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/tree-ssa-loop-prefetch.c
trunk/gcc/tree-ssa-math-opts.c


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #15 from Uros Bizjak  2011-08-02 20:22:27 
UTC ---
(In reply to comment #14)
> (In reply to comment #13)
> > (In reply to comment #10)
> > > Here is the problem:
> > 
> > No, in your case new insn is rejected (twice):
> > 
> > Trying 434 -> 435:
> > Failed to match this instruction:
> > (parallel [
> > (set (reg/f:SI 364)
> > (if_then_else:SI (eq:SI (reg:SI 442)
> > (const_int 0 [0]))
> > (const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 
> > 0x2] 
> > )
> > (const_int -4 [0xfffc])))
> > (const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 
> > 0x2] 
> > )
> > (const_int 4 [0x4])
> > (clobber (reg:CC 17 flags))
> > ])
> > Failed to match this instruction:
> > (set (reg/f:SI 364)
> > (if_then_else:SI (eq:SI (reg:SI 442)
> > (const_int 0 [0]))
> > (const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
> > )
> > (const_int -4 [0xfffc])))
> > (const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
> > )
> > (const_int 4 [0x4])
> 
> When new insns (even if they are rejected) are generated, max_uid_known
> is increased, which breaks combine due to the fixed arrays allocated
> at the beginning of the combine pass:
> 
>  /* Allocate array for insn info.  */
>   max_uid_known = get_max_uid ();
>   uid_log_links = XCNEWVEC (struct insn_link *, max_uid_known + 1); 
>   uid_insn_cost = XCNEWVEC (int, max_uid_known + 1); 
>   gcc_obstack_init (&insn_link_obstack);

Yeah, following ""patch"" works:

Index: combine.c
===
--- combine.c(revision 177171)
+++ combine.c(working copy)
@@ -1102,8 +1102,8 @@ combine_instructions (rtx f, unsigned in

   /* Allocate array for insn info.  */
   max_uid_known = get_max_uid ();
-  uid_log_links = XCNEWVEC (struct insn_link *, max_uid_known + 1);
-  uid_insn_cost = XCNEWVEC (int, max_uid_known + 1);
+  uid_log_links = XCNEWVEC (struct insn_link *, max_uid_known + 100);
+  uid_insn_cost = XCNEWVEC (int, max_uid_known + 100);
   gcc_obstack_init (&insn_link_obstack);

   nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0);

It produces something that looks like correct assembly...

Paolo?


[Bug c++/43886] [C++0x] name lookup failure on un-used local variable in lambda compound-statement

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43886

Jason Merrill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.08.02 20:19:05
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1


[Bug debug/49951] Debug stepping behavior regarding g++ Class destructor has changed for the worse starting at gcc 4.5.0

2011-08-02 Thread peter.thompson at roguewave dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49951

--- Comment #1 from Peter Thompson  
2011-08-02 20:15:10 UTC ---
Note that when the Class destructor is commented out

//  ~MyClass() {};  // destructor

then the debugger steps through the code without jumping around.  Go figure!


[Bug fortran/49885] [4.6/4.7 Regression] Segmentation fault when writing to an automatic character array

2011-08-02 Thread domob at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49885

--- Comment #9 from Daniel Kraft  2011-08-02 20:15:08 
UTC ---
Fixed on trunk.  I will also backport to 4.6 later, and then close the PR.


[Bug tree-optimization/49227] [4.7 Regression] ice in inline_small_functions

2011-08-02 Thread dcb314 at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49227

--- Comment #6 from dcb  2011-08-02 20:09:55 UTC ---
(In reply to comment #5)
> Confirmed that my testcase no longer reproduces, as of svn revision 177081 or
> earlier.

I confirm that it seems to be fixed for me as of snapshot 20110730


[Bug fortran/49885] [4.6/4.7 Regression] Segmentation fault when writing to an automatic character array

2011-08-02 Thread domob at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49885

--- Comment #8 from Daniel Kraft  2011-08-02 20:10:17 
UTC ---
Author: domob
Date: Tue Aug  2 20:10:13 2011
New Revision: 177211

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177211
Log:
2011-08-02  Daniel Kraft  

PR fortran/49885
* trans-array.c (gfc_trans_auto_array_allocation): Change
gfc_start_block to gfc_init_block to avoid spurious extra-scope.

2011-08-02  Daniel Kraft  

PR fortran/49885
* gfortran.dg/auto_char_dummy_array_3.f90: New test.

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


[Bug debug/49951] New: Debug stepping behavior regarding g++ Class destructor has changed for the worse starting at gcc 4.5.0

2011-08-02 Thread peter.thompson at roguewave dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49951

   Summary: Debug stepping behavior regarding g++ Class destructor
has changed for the worse starting at gcc 4.5.0
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: peter.thomp...@roguewave.com


Created attachment 24896
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24896
Test source file

While this was reported to us as a problem with the TotalView debugger, the
same behavior is seen with gdb as well.   In short the call to a class
destructor no longer seems to take place inline or at the end (fini section) of
a routine, but instead jumps back to the declaration of the class instance,
before proceeding forward again.  So as one steps through the code, the
debugger focus appears to jump around the routine rather than proceeding in a
straight forward manner.  

Here is the test code from a user at the European Centre for Mid-Range Weather
Forecasting (ECMWF).

-
#include 

class MyClass
{
public:
  MyClass() {};  // constructor
 ~MyClass() {};  // destructor
};


int main (int argc, char *argv[])
{
 int i = 1;
 MyClass m;

 if (i == 1)
 {
 printf ("Hello world %d\n", i);
 }
}
--

Compile 

g++ -g -O0 -o myclass myclass.cxx

Debug

[petert@magny e30025_gcc-517] gdb myclass
GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from
/nfs/netapp0/user/home/petert/repro/e30025_gcc/myclass...done.
(gdb) l
4   {
5   public:
6 MyClass() {};  // constructor
7~MyClass() {};  // destructor
8   };
9
10
11  int main (int argc, char *argv[])
12  {
13   int i = 1;
(gdb) b 13
Breakpoint 1 at 0x400614: file myclass.cxx, line 13.
(gdb) run
Starting program: /nfs/netapp0/user/home/petert/repro/e30025_gcc/myclass 

Breakpoint 1, main (argc=1, argv=0x7fffdb78) at myclass.cxx:13
13   int i = 1;
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.7.el6.x86_64
(gdb) n
14   MyClass m;
(gdb) n
16   if (i == 1)
(gdb) n
18   printf ("Hello world %d\n", i);
(gdb) n
Hello world 1
14   MyClass m;
(gdb) n
20  }


The question here is why does a 'next' take us from line 18 to line 14, and
then back to 20?   Actually the 'why' is easy enough to see in the debug info
line number statements:

Line Number Statements:
  Extended opcode 2: set Address to 0x400674
  Special opcode 10: advance Address by 0 to 0x400674 and Line by 5 to 6
  Special opcode 117: advance Address by 8 to 0x40067c and Line by 0 to 6
  Advance PC by 2 to 0x40067e
  Extended opcode 1: End of Sequence

  Extended opcode 2: set Address to 0x40067e
  Special opcode 11: advance Address by 0 to 0x40067e and Line by 6 to 7
  Special opcode 117: advance Address by 8 to 0x400686 and Line by 0 to 7
  Advance PC by 2 to 0x400688
  Extended opcode 1: End of Sequence

  Extended opcode 2: set Address to 0x400604
  Advance Line by 11 to 12
  Copy
  Special opcode 230: advance Address by 16 to 0x400614 and Line by 1 to 13
  Special opcode 104: advance Address by 7 to 0x40061b and Line by 1 to 14
  Special opcode 175: advance Address by 12 to 0x400627 and Line by 2 to 16
  Special opcode 91: advance Address by 6 to 0x40062d and Line by 2 to 18
  Advance PC by constant 17 to 0x40063e
  Special opcode 43: advance Address by 3 to 0x400641 and Line by -4 to 14
  Advance PC by constant 17 to 0x400652
  Special opcode 11: advance Address by 0 to 0x400652 and Line by 6 to 20
  Advance Line by -6 to 14
  Special opcode 145: advance Address by 10 to 0x40065c and Line by 0 to 14
  Advance PC by 23 to 0x400673
  Extended opcode 1: End of Sequence


This behavior was introduced in 4.5.0.  I have not tested all versions, but
4.4.1 stepped from line 18 to line 19 (the closing bracket) and never backed up
to line 14.  This is the expected behavior.  I've tested up to gcc 4.6.1 and
the new, annoying, behavior is still in place.

The specific version I used was:

 g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/nfs/netapp0/user/home/compilers/gnu/gcc/4.5.1/x86_64-linux/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.1/lto-wrapper
Target: x86_64-unknown-li

[Bug c++/49577] [C++0x] narrowing conversion not rejected

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49577

Jason Merrill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.08.02 20:00:06
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1


[Bug target/49824] [avr] Missing documentation for OS_task and OS_main attributes

2011-08-02 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49824

Georg-Johann Lay  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.08.02 19:45:51
Summary|AVR: Missing documentation  |[avr] Missing documentation
   |for OS_task and OS_main |for OS_task and OS_main
   |attributes  |attributes
 Ever Confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #1 from Georg-Johann Lay  2011-08-02 
19:45:51 UTC ---
Found a description here:

http://lists.gnu.org/archive/html/avr-gcc-list/2007-07/msg00075.html


[Bug target/49950] New: GOT relocation for -fPIE is excessive

2011-08-02 Thread jan.kratochvil at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49950

   Summary: GOT relocation for -fPIE is excessive
   Product: gcc
   Version: 4.4.7
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: target
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: jan.kratoch...@redhat.com
Target: x86_64-unknown-linux-gnu


FAIL: gcc (GCC) 4.4.7 20110802 (prerelease)
FAIL: gcc (GCC) 4.5.4 20110802 (prerelease)
FAIL: gcc (GCC) 4.6.2 20110802 (prerelease)
FAIL: gcc (GCC) 4.7.0 20110802 (experimental)

echo 'int i; int f (void) { return i; }' | gcc -c -o 20.o -Wall -fPIE -x c -
readelf -Wr 20.o
0007  00080009 R_X86_64_GOTPCREL  0004 i -
4

none:  R_X86_64_PC32 is correct
-fPIE: R_X86_64_GOTPCREL is excessive - this Bug
-fPIC: R_X86_64_GOTPCREL is correct

Jakub:
the difference between -fPIE and -fPIC is that the former assumes that you
can't override its symbols
so if it sees some symbol defined in the current source file, it knows that it
will be the definition at runtime
for -shared libraries that is not true, other shared libraries defining the
same symbol can override it, so they need more runtime relocations


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #14 from H.J. Lu  2011-08-02 19:42:30 
UTC ---
(In reply to comment #13)
> (In reply to comment #10)
> > Here is the problem:
> 
> No, in your case new insn is rejected (twice):
> 
> Trying 434 -> 435:
> Failed to match this instruction:
> (parallel [
> (set (reg/f:SI 364)
> (if_then_else:SI (eq:SI (reg:SI 442)
> (const_int 0 [0]))
> (const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
> )
> (const_int -4 [0xfffc])))
> (const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
> )
> (const_int 4 [0x4])
> (clobber (reg:CC 17 flags))
> ])
> Failed to match this instruction:
> (set (reg/f:SI 364)
> (if_then_else:SI (eq:SI (reg:SI 442)
> (const_int 0 [0]))
> (const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
> )
> (const_int -4 [0xfffc])))
> (const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
> )
> (const_int 4 [0x4])

When new insns (even if they are rejected) are generated, max_uid_known
is increased, which breaks combine due to the fixed arrays allocated
at the beginning of the combine pass:

 /* Allocate array for insn info.  */
  max_uid_known = get_max_uid ();
  uid_log_links = XCNEWVEC (struct insn_link *, max_uid_known + 1); 
  uid_insn_cost = XCNEWVEC (int, max_uid_known + 1); 
  gcc_obstack_init (&insn_link_obstack);


[Bug middle-end/49947] [4.7 Regression] FAIL: gcc.dg/tree-ssa/forwprop-15.c

2011-08-02 Thread ktietz at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49947

Kai Tietz  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED

--- Comment #2 from Kai Tietz  2011-08-02 19:33:50 
UTC ---
Fixed


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #13 from Uros Bizjak  2011-08-02 19:32:46 
UTC ---
(In reply to comment #10)
> Here is the problem:

No, in your case new insn is rejected (twice):

Trying 434 -> 435:
Failed to match this instruction:
(parallel [
(set (reg/f:SI 364)
(if_then_else:SI (eq:SI (reg:SI 442)
(const_int 0 [0]))
(const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
)
(const_int -4 [0xfffc])))
(const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
)
(const_int 4 [0x4])
(clobber (reg:CC 17 flags))
])
Failed to match this instruction:
(set (reg/f:SI 364)
(if_then_else:SI (eq:SI (reg:SI 442)
(const_int 0 [0]))
(const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
)
(const_int -4 [0xfffc])))
(const:SI (plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] 
)
(const_int 4 [0x4])


[Bug middle-end/49947] [4.7 Regression] FAIL: gcc.dg/tree-ssa/forwprop-15.c

2011-08-02 Thread ktietz at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49947

--- Comment #1 from Kai Tietz  2011-08-02 19:31:33 
UTC ---
Author: ktietz
Date: Tue Aug  2 19:31:30 2011
New Revision: 177205

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177205
Log:
2011-08-02  Kai Tietz  

PR middle-end/49947
* gcc.dg/tree-ssa/forwprop-15.c


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/forwprop-15.c


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #12 from H.J. Lu  2011-08-02 19:29:12 
UTC ---
combine.c has

 /* Allocate array for insn info.  */
  max_uid_known = get_max_uid ();
  uid_log_links = XCNEWVEC (struct insn_link *, max_uid_known + 1); 
  uid_insn_cost = XCNEWVEC (int, max_uid_known + 1); 
  gcc_obstack_init (&insn_link_obstack);

combine isn't prepared to deal with new insns generated by
convert_memory_address_addr_space and it accesses invalid
memory in

FOR_EACH_LOG_LINK (link, temp)
  if (link->insn == i2)
link->insn = i3;

on those newly generated insns.


[Bug c++/49593] [C++0x] cannot use T{t}... as pack expansion

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49593

Jason Merrill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.08.02 19:24:30
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #11 from Uros Bizjak  2011-08-02 19:19:06 
UTC ---
So, we have:

(insn 129 128 131 2 (set (reg:DI 276)
(sign_extend:DI (reg:SI 277))) pr49721.f:10 123 {*extendsidi2_rex64}
 (expr_list:REG_DEAD (reg:SI 277)
(nil)))

...

(insn 132 131 133 2 (set (reg:SF 279)
(mult:SF (reg:SF 146 [ D.1599 ])
(reg:SF 280))) pr49721.f:10 732 {*fop_sf_comm_sse}
 (expr_list:REG_DEAD (reg:SF 146 [ D.1599 ])
(expr_list:REG_EQUAL (mult:SF (reg:SF 146 [ D.1599 ])
(const_double:SF +Inf [+Inf]))
(nil

(insn 133 132 134 2 (set (mem/s:SF (plus:DI (reg:DI 276)
(symbol_ref:DI ("xq.1569") [flags 0x2]  )) [3 xq S4 A32])
(reg:SF 279)) pr49721.f:10 107 {*movsf_internal}
 (expr_list:REG_DEAD (reg:SF 279)
(expr_list:REG_DEAD (reg:DI 276)
(nil

And combine creates:

Trying 132, 129 -> 133:

...

Successfully matched this instruction:
(set (reg:DI 279)
(sign_extend:DI (reg:SI 277)))
Failed to match this instruction:
(set (mem/s:SF (plus:DI (reg:DI 279)
(symbol_ref:DI ("xq.1569") [flags 0x2]  )) [3 xq S4 A32])
(mult:SF (reg:SF 146 [ D.1599 ])
(reg:SF 280)))

A ... WHAT?


[Bug c++/49949] New: wrong sign for product of complex and double with -O2

2011-08-02 Thread begovic79 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949

   Summary: wrong sign for product of complex and double
with -O2
   Product: gcc
   Version: 4.5.2
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: begovi...@gmail.com


With the -O2 flag and in a very specialized circumstance, the product of a
complex and a double has the wrong sign.

The problem arises when the blitz++ array library is used.
(http://www.oonumerics.org/blitz/) Unfortunately, I could not prune out all the
references to the unnecessary C++ standard libraries. The size of the .ii file
is therefore pretty big. I hope the report will still be useful.

The output of the executable gcc_complex_bug should be

(-0.0,-1.0)x100.0=(0.0,100.0)

which shows the wrong sign for the product.

The following is the output of "g++ -v -save-temps -I. -O2 -o gcc_complex_bug
gcc_complex_bug.cpp"

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.5 --enable-shared --enable-multiarch
--with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu
--enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default
--with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-I.' '-O2' '-o' 'gcc_complex_bug'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus -E -quiet -v -I.
-D_GNU_SOURCE gcc_complex_bug.cpp -D_FORTIFY_SOURCE=2 -mtune=generic
-march=x86-64 -O2 -fpch-preprocess -fstack-protector -o gcc_complex_bug.ii
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /usr/include/c++/4.5
 /usr/include/c++/4.5/x86_64-linux-gnu
 /usr/include/c++/4.5/backward
 /usr/local/include
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/include
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-I.' '-O2' '-o' 'gcc_complex_bug'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus -fpreprocessed
gcc_complex_bug.ii -quiet -dumpbase gcc_complex_bug.cpp -mtune=generic
-march=x86-64 -auxbase gcc_complex_bug -O2 -version -fstack-protector -o
gcc_complex_bug.s
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (x86_64-linux-gnu)
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (x86_64-linux-gnu)
compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1a8763bcd4db37297f4ae8b8aab36cf0
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-I.' '-O2' '-o' 'gcc_complex_bug'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -V -Qy --64 -o gcc_complex_bug.o gcc_complex_bug.s
GNU assembler version 2.21.0 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Ubuntu) 2.21.0.20110327
COMPILER_PATH=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../:/lib/:/usr/lib/:/usr/lib/x86_64-linux-gnu/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-I.' '-O2' '-o' 'gcc_complex_bug'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/collect2 --build-id
--eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -z relro -o gcc_complex_bug
/usr/lib/x86_64

[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #10 from H.J. Lu  2011-08-02 19:17:43 
UTC ---
Here is the problem:

(gdb) 
Continuing.

Breakpoint 1, convert_memory_address_addr_space (to_mode=DImode, 
x=0x707f73c0, as=0 '\000')
at /export/gnu/import/git/gcc/gcc/explow.c:409
409  return convert_modes (to_mode, from_mode,
(plus:SI (symbol_ref:SI ("iplane.1553") [flags 0x2] )
(const_int -4 [0xfffc]))
(gdb) bt
#0  convert_memory_address_addr_space (to_mode=DImode, x=0x707f73c0, 
as=0 '\000') at /export/gnu/import/git/gcc/gcc/explow.c:409
#1  0x00789f95 in convert_memory_address_addr_space (to_mode=DImode, 
x=0x707f1c70, as=0 '\000')
at /export/gnu/import/git/gcc/gcc/explow.c:380
#2  0x00b12b4f in simplify_unary_operation_1 (code=ZERO_EXTEND, 
mode=DImode, op=0x707f1c70)
at /export/gnu/import/git/gcc/gcc/simplify-rtx.c:1246
#3  0x00b108ae in simplify_unary_operation (code=ZERO_EXTEND, 
mode=DImode, op=0x707f1c70, op_mode=SImode)
at /export/gnu/import/git/gcc/gcc/simplify-rtx.c:582
#4  0x00b10092 in simplify_gen_unary (code=ZERO_EXTEND, mode=DImode, 
op=0x707f1c70, op_mode=SImode)
at /export/gnu/import/git/gcc/gcc/simplify-rtx.c:370
#5  0x0116cb9a in if_then_else_cond (x=0x707beb40, 
ptrue=0x7fffd370, pfalse=0x7fffd368)
at /export/gnu/import/git/gcc/gcc/combine.c:8650
#6  0x011639b0 in combine_simplify_rtx (x=0x707beb40, 
op0_mode=SImode, in_dest=0, in_cond=0)
at /export/gnu/import/git/gcc/gcc/combine.c:5316
#7  0x01163710 in subst (x=0x707beb40, from=0x707c5ac0, 
to=0x707f73d8, in_dest=0, in_cond=0, unique_copy=0)
at /export/gnu/import/git/gcc/gcc/combine.c:5253
---Type  to continue, or q  to quit---
#8  0x011634ff in subst (x=0x707ca990, from=0x707c5ac0, 
to=0x707f73d8, in_dest=0, in_cond=0, unique_copy=0)
at /export/gnu/import/git/gcc/gcc/combine.c:5189
#9  0x0115d5d6 in try_combine (i3=0x707cb708, i2=0x707cb6c0, 
i1=0x0, i0=0x0, new_direct_jump_p=0x7fffda64, 
last_combined_insn=0x707cb708)
at /export/gnu/import/git/gcc/gcc/combine.c:3178
#10 0x011588af in combine_instructions (f=0x707ab880, nregs=487)
at /export/gnu/import/git/gcc/gcc/combine.c:1223
#11 0x01178a5e in rest_of_handle_combine ()
at /export/gnu/import/git/gcc/gcc/combine.c:13880
#12 0x00a5384c in execute_one_pass (pass=0x190e600)
at /export/gnu/import/git/gcc/gcc/passes.c:2063
#13 0x00a53a32 in execute_pass_list (pass=0x190e600)
at /export/gnu/import/git/gcc/gcc/passes.c:2118
#14 0x00a53a53 in execute_pass_list (pass=0x1909260)
at /export/gnu/import/git/gcc/gcc/passes.c:2119
#15 0x00bec908 in tree_rest_of_compilation (fndecl=0x70945b00)
at /export/gnu/import/git/gcc/gcc/tree-optimize.c:416
#16 0x006d4d95 in cgraph_expand_function (node=0x7074a900)
at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1803
#17 0x006d4f54 in cgraph_expand_all_functions ()
at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1862
---Type  to continue, or q  to quit---
#18 0x006d5650 in cgraph_optimize ()
at /export/gnu/import/git/gcc/gcc/cgraphunit.c:2132
#19 0x006d2acd in cgraph_finalize_compilation_unit ()
at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1310
#20 0x009cf010 in write_global_declarations ()
at /export/gnu/import/git/gcc/gcc/langhooks.c:303
#21 0x00559ed0 in gfc_write_global_declarations ()
at /export/gnu/import/git/gcc/gcc/fortran/f95-lang.c:322
#22 0x00b49830 in compile_file ()
at /export/gnu/import/git/gcc/gcc/toplev.c:564
#23 0x00b4ba1a in do_compile ()
at /export/gnu/import/git/gcc/gcc/toplev.c:1886
#24 0x00b4bb8a in toplev_main (argc=19, argv=0x7fffdef8)
at /export/gnu/import/git/gcc/gcc/toplev.c:1962
#25 0x0060d9ac in main (argc=19, argv=0x7fffdef8)
at /export/gnu/import/git/gcc/gcc/main.c:36
(gdb) 

In combine, we can't generate any new insns. But we do generate
new insns in this case.


[Bug target/49878] [h8300] ICE in based_loc_descr, at dwarf2out.c:10478

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49878

--- Comment #4 from Richard Henderson  2011-08-02 
18:48:04 UTC ---
Author: rth
Date: Tue Aug  2 18:48:00 2011
New Revision: 177200

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177200
Log:
PR target/49878
h8300: Don't allow eliminable registers to be pushed.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/h8300/h8300-protos.h
trunk/gcc/config/h8300/h8300.c
trunk/gcc/config/h8300/h8300.md
trunk/gcc/config/h8300/predicates.md


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #9 from Uros Bizjak  2011-08-02 18:36:33 
UTC ---
(In reply to comment #8)

> > #0  try_combine (i3=, i2=, i1=0x0, 
> > i0= > out>, new_direct_jump_p=0x7fffdf54, 
> > last_combined_insn=0x71a12c60) at
> > ../../gcc-svn/trunk/gcc/combine.c:4154
> 
> That is because simplify-rtx.c generates new insns via
> convert_memory_address_addr_space.

Yeah, but during the combine pass?!

Every memory access before the combine is referred via DImode symbol and/or
DImode reg combination, which is perfectly OK.

It looks to me that combine pass needs some additional conditions to not do
stupid things. To confirm this, try disabling combine pass with:

Index: combine.c
===
--- combine.c(revision 177171)
+++ combine.c(working copy)
@@ -13861,7 +13861,7 @@
 static bool
 gate_handle_combine (void)
 {
-  return (optimize > 0);
+  return (0 && optimize > 0);
 }

 /* Try combining insns through substitution.  */

This ""patch"" fixes the segfault.


[Bug c++/49803] [C++0x] erroneous variant-member initialization in a union containing an anonymous struct

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49803

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #2 from Jason Merrill  2011-08-02 
18:33:44 UTC ---
Agreed.  But note that the standard doesn't include anonymous structs, so this
is not a pedantically conforming program.


[Bug c++/49260] [C++0x] lambda-eh2.C fails execution

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49260

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|4.7.0   |4.6.2

--- Comment #11 from Jason Merrill  2011-08-02 
18:31:52 UTC ---
Fixed for 4.6.2.


[Bug c++/49834] [C++0x] type deduction in for-each loop in template function

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49834

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #4 from Jason Merrill  2011-08-02 
18:11:43 UTC ---
Fixed.


[Bug c++/49834] [C++0x] type deduction in for-each loop in template function

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49834

--- Comment #3 from Jason Merrill  2011-08-02 
18:09:02 UTC ---
Author: jason
Date: Tue Aug  2 18:08:58 2011
New Revision: 177199

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177199
Log:
PR c++/49834
* parser.c (build_range_temp): Split out from...
(cp_convert_range_for): ...here.
(do_range_for_auto_deduction): New.
(cp_parser_range_for): Use it.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/range-for20.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/49885] [4.6/4.7 Regression] Segmentation fault when writing to an automatic character array

2011-08-02 Thread domob at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49885

--- Comment #7 from Daniel Kraft  2011-08-02 17:55:38 
UTC ---
This seems to be fixed by changing gfc_start_block in
trans-array.c:gfc_trans_auto_array_allocation to gfc_init_block.  That's the
way it already was in trans-decl.c:gfc_trans_auto_character_variable, which
contains very similar code but did not create the "extra" scope.

I'll regtest this patch and submit if it does not introduce other failures.


[Bug tree-optimization/49227] [4.7 Regression] ice in inline_small_functions

2011-08-02 Thread arthur.j.odwyer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49227

--- Comment #5 from Arthur O'Dwyer  
2011-08-02 17:47:20 UTC ---
Confirmed that my testcase no longer reproduces, as of svn revision 177081 or
earlier.


[Bug rtl-optimization/49948] ICE with -ftree-parallelize-loops: "address taken, but ADDRESSABLE bit not set"

2011-08-02 Thread arthur.j.odwyer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49948

--- Comment #1 from Arthur O'Dwyer  
2011-08-02 17:43:00 UTC ---
Created attachment 24895
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24895
Output of "gcc-4.5 -O3 -ftree-parallelize-loops=2 -std=c99 -c test.c -v"


[Bug ada/49944] [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with "s-taprop.adb:856:10: "pthread_attr_setaffinity_np" is undefined (more references follow)"

2011-08-02 Thread charlet at adacore dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49944

--- Comment #4 from charlet at adacore dot com  
2011-08-02 17:42:05 UTC ---
> I would not be so assertive as Arno.

Really? As the person who wrote this file and as the main tasking expert
of GNAT, I think I can be so assertive on this topic.

> It seems to me (but I may be wrong) that
> s-taprop-linux.adb really only calls glibc and libpthread, not the
> kernel, and
> therefore should be called s-taprop-glibc.adb.  It looks like the
> kernel-specific calls are all in
> s-osinte-{linux,freebsd,kfreebsd-gnu}.ads,

No, s-taprop-linux.adb is only meant to be used under Linux and only
guaranteed to work under linux.

Using this file on non linux systems is bound to cause troubles and is not a
good idea.

If you're looking for a file shared among several platforms with a known
API, then as I said, using s-taprop-posix.adb is the way to go. That's what
I would do anyway if I were to port GNAT to kfreebsd properly.

Arno


[Bug rtl-optimization/49948] New: ICE with -ftree-parallelize-loops: "address taken, but ADDRESSABLE bit not set"

2011-08-02 Thread arthur.j.odwyer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49948

   Summary: ICE with -ftree-parallelize-loops: "address taken, but
ADDRESSABLE bit not set"
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: arthur.j.odw...@gmail.com


Created attachment 24894
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24894
Output of "ajo-gcc -O3 -ftree-parallelize-loops=2 -std=c99 -c test.c -v"

This failure reproduces for me with svn revision 177081 (2011-08-02), and also
with gcc 4.5.1. I'm on Ubuntu 10.10, x86-64 (-march=amdfam10).

cat >test.c 

Re: [Bug ada/49944] [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with "s-taprop.adb:856:10: "pthread_attr_setaffinity_np" is undefined (more references follow)"

2011-08-02 Thread Arnaud Charlet
> I would not be so assertive as Arno.

Really? As the person who wrote this file and as the main tasking expert
of GNAT, I think I can be so assertive on this topic.

> It seems to me (but I may be wrong) that
> s-taprop-linux.adb really only calls glibc and libpthread, not the
> kernel, and
> therefore should be called s-taprop-glibc.adb.  It looks like the
> kernel-specific calls are all in
> s-osinte-{linux,freebsd,kfreebsd-gnu}.ads,

No, s-taprop-linux.adb is only meant to be used under Linux and only
guaranteed to work under linux.

Using this file on non linux systems is bound to cause troubles and is not a
good idea.

If you're looking for a file shared among several platforms with a known
API, then as I said, using s-taprop-posix.adb is the way to go. That's what
I would do anyway if I were to port GNAT to kfreebsd properly.

Arno


[Bug ada/49940] [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with "s-taprop.adb:717:32: "lwp_self" is undefined"

2011-08-02 Thread ludo...@ludovic-brenta.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49940

--- Comment #2 from Ludovic Brenta  2011-08-02 
17:39:02 UTC ---
I found that declaring lwp_self in s-osinte-kfreebsd-gnu.ads similarly to the
declaration in s-osinte-freebsd.ads fixed the problem.   Patch submitted as
http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00139.html.


[Bug target/49881] [AVR] Inefficient stack manipulation around calls

2011-08-02 Thread rth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49881

--- Comment #9 from Richard Henderson  2011-08-02 
17:38:22 UTC ---
Author: rth
Date: Tue Aug  2 17:38:16 2011
New Revision: 177196

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177196
Log:
PR target/49881
* config/avr/avr.md (push1): Don't constrain the operand.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/avr/avr.md


[Bug ada/49944] [4.5/4.6/4.7 regression] Bootstrapping on x86_64-pc-kfreebsd-gnu fails with "s-taprop.adb:856:10: "pthread_attr_setaffinity_np" is undefined (more references follow)"

2011-08-02 Thread ludo...@ludovic-brenta.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49944

--- Comment #3 from Ludovic Brenta  2011-08-02 
17:30:43 UTC ---
I would not be so assertive as Arno.  It seems to me (but I may be wrong) that
s-taprop-linux.adb really only calls glibc and libpthread, not the kernel, and
therefore should be called s-taprop-glibc.adb.  It looks like the
kernel-specific calls are all in s-osinte-{linux,freebsd,kfreebsd-gnu}.ads,
which have the proper names.  GNU/kFreeBSD uses the GNU glibc instead of
FreeBSD's libc, so I think s-taprop-linux.adb is appropriate there.


[Bug fortran/42041] Missing defs in omp_lib.h

2011-08-02 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42041

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #8 from Jakub Jelinek  2011-08-02 
17:15:28 UTC ---
In 4.7+.


[Bug fortran/46752] OpenMP - Seg fault for unallocated allocatable array in firstprivate clause

2011-08-02 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46752

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #9 from Jakub Jelinek  2011-08-02 
17:14:55 UTC ---
In 4.7+.


[Bug rtl-optimization/49114] [x32] Reload failed to handle (set reg:X (plus:X (subreg:X (reg:Y) 0) (const_int)))

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49114

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED
Summary|Reload failed to handle |[x32] Reload failed to
   |(set reg:X (plus:X  |handle (set reg:X (plus:X
   |(subreg:X (reg:Y) 0)|(subreg:X (reg:Y) 0)
   |(const_int)))   |(const_int)))

--- Comment #15 from H.J. Lu  2011-08-02 17:07:22 
UTC ---
Fixed.


[Bug libgcj/49193] __sync_xxxx builtins aren't used in sysdep/*/locks.h

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49193

H.J. Lu  changed:

   What|Removed |Added

 Target||x86
 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #2 from H.J. Lu  2011-08-02 17:07:55 
UTC ---
Fixed.


[Bug middle-end/49947] New: [4.7 Regression] FAIL: gcc.dg/tree-ssa/forwprop-15.c

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49947

   Summary: [4.7 Regression] FAIL: gcc.dg/tree-ssa/forwprop-15.c
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: hjl.to...@gmail.com


On Linux/x86, revision 177171 gave

FAIL: gcc.dg/tree-ssa/forwprop-15.c (test for excess errors)

Revision 177081 is OK.


[Bug fortran/42041] Missing defs in omp_lib.h

2011-08-02 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42041

--- Comment #7 from Jakub Jelinek  2011-08-02 
16:13:35 UTC ---
Author: jakub
Date: Tue Aug  2 16:13:29 2011
New Revision: 177194

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177194
Log:
Merge from gomp-3_1-branch branch:

2011-08-02  Jakub Jelinek  

gcc/
* c-parser.c (enum c_parser_prec): New enum, moved from within
c_parser_binary_expression.
(c_parser_binary_expression): Add PREC argument.  Stop parsing
if operator has lower or equal precedence than PREC.
(c_parser_conditional_expression, c_parser_omp_for_loop): Adjust
callers.
(c_parser_omp_atomic): Handle parsing OpenMP 3.1 atomics.
Adjust c_finish_omp_atomic caller.
(c_parser_omp_taskyield): New function.
(c_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
(c_parser_omp_clause_name): Handle final and mergeable clauses.
(c_parser_omp_clause_final, c_parser_omp_clause_mergeable): New
functions.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
and PRAGMA_OMP_CLAUSE_MERGEABLE.
(OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
(c_parser_omp_clause_reduction): Handle min and max.
* c-typeck.c (c_finish_omp_clauses): Don't complain about
const qualified predetermined vars in firstprivate clause.
andle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
Handle MIN_EXPR and MAX_EXPR.
* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_FINAL
and OMP_CLAUSE_MERGEABLE.
(dump_generic_node): Handle OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD
and OMP_ATOMIC_CAPTURE_NEW.
* tree.c (omp_clause_num_ops): Add OMP_CLAUSE_FINAL and
OMP_CLAUSE_MERGEABLE.
(omp_clause_code_name): Likewise.
(walk_tree_1): Handle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
* tree.h (enum omp_clause_code): Add OMP_CLAUSE_FINAL
and OMP_CLAUSE_MERGEABLE.
(OMP_CLAUSE_FINAL_EXPR): Define.
* omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_FINAL and
OMP_CLAUSE_MERGEABLE.
(expand_task_call): Likewise.
(expand_omp_atomic_load, expand_omp_atomic_store): New functions.
(expand_omp_atomic_fetch_op): Handle cases where old or new
value is needed afterwards.
(expand_omp_atomic): Call expand_omp_atomic_load resp.
expand_omp_atomic_store.
* gimplify.c (gimplify_omp_atomic, gimplify_expr): Handle
OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD and OMP_ATOMIC_CAPTURE_NEW.
(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Likewise.
* tree.def (OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD,
OMP_ATOMIC_CAPTURE_NEW): New.
* gimple.h (GF_OMP_ATOMIC_NEED_VALUE): New.
(gimple_omp_atomic_need_value_p, gimple_omp_atomic_set_need_value):
New inlines.
* omp-builtins.def (BUILT_IN_GOMP_TASKYIELD): New builtin.
* doc/generic.texi: Mention OMP_CLAUSE_COLLAPSE,
OMP_CLAUSE_UNTIED, OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
gcc/c-family/
* c-common.h (c_finish_omp_atomic): Adjust prototype.
(c_finish_omp_taskyield): New prototype.
* c-omp.c (c_finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
arguments. Handle OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD and
OMP_ATOMIC_CAPTURE_NEW in addition to OMP_ATOMIC.  If LHS1
or RHS1 have side-effects, evaluate those too in the right spot,
if it is a decl and LHS is also a decl, error out if they
aren't the same.
(c_finish_omp_taskyield): New function.
* c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP to 201107.
* c-pragma.c (omp_pragmas): Add taskyield.
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_TASKYIELD.
(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_FINAL and
PRAGMA_OMP_CLAUSE_MERGEABLE.
gcc/cp/
* cp-tree.h (finish_omp_atomic): Adjust prototype.
(cxx_omp_const_qual_no_mutable): New prototype.
(finish_omp_taskyield): New prototype.
* parser.c (cp_parser_omp_atomic): (cp_parser_omp_atomic): Handle
parsing OpenMP 3.1 atomics.  Adjust finish_omp_atomic caller.
(cp_parser_omp_clause_name): Handle final and mergeable clauses.
(cp_parser_omp_clause_final, cp_parser_omp_clause_mergeable): New
functions.
(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
and PRAGMA_OMP_CLAUSE_MERGEABLE.
(OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
(cp_parser_omp_taskyield): New function.
(cp_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
(cp_parser_omp_clause_reduction): Handle min and max.
* pt.c (tsubst_expr) : Handle OpenMP 3.1 atomics.
(tsubst_omp_clauses): Handle OMP_CLAUSE_FINAL and
OMP_CLAUSE_MERGEABLE.
* semantics.c (finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
arguments.  Handle OpenMP 3.1 atomics.  Adjust c_finish_omp_atomic
caller.
(finish_omp_clauses): Don't complain about const qualified
predetermined vars and static data members

[Bug c++/49924] [C++0X] [constexpr] can't initialize a non-static member array of a literal type as a constexpr

2011-08-02 Thread faisalv at yahoo dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49924

--- Comment #4 from Faisal Vali  2011-08-02 16:15:18 
UTC ---
wow - that was quick - thank you Jason!!


[Bug fortran/46752] OpenMP - Seg fault for unallocated allocatable array in firstprivate clause

2011-08-02 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46752

--- Comment #8 from Jakub Jelinek  2011-08-02 
16:13:35 UTC ---
Author: jakub
Date: Tue Aug  2 16:13:29 2011
New Revision: 177194

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177194
Log:
Merge from gomp-3_1-branch branch:

2011-08-02  Jakub Jelinek  

gcc/
* c-parser.c (enum c_parser_prec): New enum, moved from within
c_parser_binary_expression.
(c_parser_binary_expression): Add PREC argument.  Stop parsing
if operator has lower or equal precedence than PREC.
(c_parser_conditional_expression, c_parser_omp_for_loop): Adjust
callers.
(c_parser_omp_atomic): Handle parsing OpenMP 3.1 atomics.
Adjust c_finish_omp_atomic caller.
(c_parser_omp_taskyield): New function.
(c_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
(c_parser_omp_clause_name): Handle final and mergeable clauses.
(c_parser_omp_clause_final, c_parser_omp_clause_mergeable): New
functions.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
and PRAGMA_OMP_CLAUSE_MERGEABLE.
(OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
(c_parser_omp_clause_reduction): Handle min and max.
* c-typeck.c (c_finish_omp_clauses): Don't complain about
const qualified predetermined vars in firstprivate clause.
andle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
Handle MIN_EXPR and MAX_EXPR.
* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_FINAL
and OMP_CLAUSE_MERGEABLE.
(dump_generic_node): Handle OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD
and OMP_ATOMIC_CAPTURE_NEW.
* tree.c (omp_clause_num_ops): Add OMP_CLAUSE_FINAL and
OMP_CLAUSE_MERGEABLE.
(omp_clause_code_name): Likewise.
(walk_tree_1): Handle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
* tree.h (enum omp_clause_code): Add OMP_CLAUSE_FINAL
and OMP_CLAUSE_MERGEABLE.
(OMP_CLAUSE_FINAL_EXPR): Define.
* omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_FINAL and
OMP_CLAUSE_MERGEABLE.
(expand_task_call): Likewise.
(expand_omp_atomic_load, expand_omp_atomic_store): New functions.
(expand_omp_atomic_fetch_op): Handle cases where old or new
value is needed afterwards.
(expand_omp_atomic): Call expand_omp_atomic_load resp.
expand_omp_atomic_store.
* gimplify.c (gimplify_omp_atomic, gimplify_expr): Handle
OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD and OMP_ATOMIC_CAPTURE_NEW.
(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Likewise.
* tree.def (OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD,
OMP_ATOMIC_CAPTURE_NEW): New.
* gimple.h (GF_OMP_ATOMIC_NEED_VALUE): New.
(gimple_omp_atomic_need_value_p, gimple_omp_atomic_set_need_value):
New inlines.
* omp-builtins.def (BUILT_IN_GOMP_TASKYIELD): New builtin.
* doc/generic.texi: Mention OMP_CLAUSE_COLLAPSE,
OMP_CLAUSE_UNTIED, OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
gcc/c-family/
* c-common.h (c_finish_omp_atomic): Adjust prototype.
(c_finish_omp_taskyield): New prototype.
* c-omp.c (c_finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
arguments. Handle OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD and
OMP_ATOMIC_CAPTURE_NEW in addition to OMP_ATOMIC.  If LHS1
or RHS1 have side-effects, evaluate those too in the right spot,
if it is a decl and LHS is also a decl, error out if they
aren't the same.
(c_finish_omp_taskyield): New function.
* c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP to 201107.
* c-pragma.c (omp_pragmas): Add taskyield.
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_TASKYIELD.
(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_FINAL and
PRAGMA_OMP_CLAUSE_MERGEABLE.
gcc/cp/
* cp-tree.h (finish_omp_atomic): Adjust prototype.
(cxx_omp_const_qual_no_mutable): New prototype.
(finish_omp_taskyield): New prototype.
* parser.c (cp_parser_omp_atomic): (cp_parser_omp_atomic): Handle
parsing OpenMP 3.1 atomics.  Adjust finish_omp_atomic caller.
(cp_parser_omp_clause_name): Handle final and mergeable clauses.
(cp_parser_omp_clause_final, cp_parser_omp_clause_mergeable): New
functions.
(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
and PRAGMA_OMP_CLAUSE_MERGEABLE.
(OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
(cp_parser_omp_taskyield): New function.
(cp_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
(cp_parser_omp_clause_reduction): Handle min and max.
* pt.c (tsubst_expr) : Handle OpenMP 3.1 atomics.
(tsubst_omp_clauses): Handle OMP_CLAUSE_FINAL and
OMP_CLAUSE_MERGEABLE.
* semantics.c (finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
arguments.  Handle OpenMP 3.1 atomics.  Adjust c_finish_omp_atomic
caller.
(finish_omp_clauses): Don't complain about const qualified
predetermined vars and static data members

[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #8 from H.J. Lu  2011-08-02 15:58:56 
UTC ---
(In reply to comment #6)
> (In reply to comment #5)
> > Another testcase:
> 
> Program received signal SIGSEGV, Segmentation fault.
> try_combine (i3=, i2=, i1=0x0, i0= out>, new_direct_jump_p=0x7fffdf54, 
> last_combined_insn=0x71a12c60) at
> ../../gcc-svn/trunk/gcc/combine.c:4154
> 4154  if (link->insn == i2)
> 
> #0  try_combine (i3=, i2=, i1=0x0, i0= out>, new_direct_jump_p=0x7fffdf54, 
> last_combined_insn=0x71a12c60) at
> ../../gcc-svn/trunk/gcc/combine.c:4154

That is because simplify-rtx.c generates new insns via
convert_memory_address_addr_space.


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #7 from H.J. Lu  2011-08-02 15:57:35 
UTC ---
Created attachment 24893
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24893
A patch

With this patch, I got many ICEs in gcc testsuite. One of
them is

[hjl@gnu-6 pr49721]$ cat x.i
struct
{
  int i;
  double e;
  int j;
} x;

void
f2 (void)
{
#pragma omp atomic
x.e /= 0.25;
}
[hjl@gnu-6 pr49721]$ make x.s
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -S -o x.s -mx32 -O2
-fopenmp  x.i
x.i: In function ‘f2’:
x.i:13:1: error: unrecognizable insn:
(insn 15 14 16 5 (set (reg/f:DI 70)
(const:DI (reg:DI 67))) x.i:12 -1
 (nil))
x.i:13:1: internal compiler error: in extract_insn, at recog.c:2115
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
make: *** [x.s] Error 1
[hjl@gnu-6 pr49721]$


[Bug c++/49834] [C++0x] type deduction in for-each loop in template function

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49834

Jason Merrill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.08.02 15:52:27
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #2 from Jason Merrill  2011-08-02 
15:52:27 UTC ---
I think we should be able to deduce the auto at template definition time, since
the range expression is not type-dependent.


[Bug middle-end/49500] [4.7 Regression]: gcc.dg/tls/alias-1.c

2011-08-02 Thread hp at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49500

--- Comment #13 from Hans-Peter Nilsson  2011-08-02 
15:43:35 UTC ---
(In reply to comment #11)
> Any updates?

Still failing at r177108 for cris-elf.  Not tested the patch, but it seems
everybody else has.

>  Was the patch applied?

Does not look committed.  I think it's just missing approval, hint, hint.


[Bug c++/49852] [4.7 Regression] cp-demangle.c segfault

2011-08-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49852

H.J. Lu  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED

--- Comment #9 from H.J. Lu  2011-08-02 15:43:06 
UTC ---
Fixed by

http://gcc.gnu.org/ml/gcc-cvs/2011-07/msg01064.html


[Bug ada/49084] [4.7 regression] bootstrap failure with Ada enabled

2011-08-02 Thread anhvofrcaus at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49084

--- Comment #4 from Anh Vo  2011-08-02 15:40:34 
UTC ---
On Tue, Aug 2, 2011 at 7:18 AM, rguenth at gcc dot gnu.org
 wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49084
>
> --- Comment #3 from Richard Guenther  2011-08-02 
> 14:12:01 UTC ---
> Does it work now?

It still fails with snapshot gcc-4.7-20110716. I am downloading
gcc-4.7-20110730 at this minute. I will report the result of it once
the build is complete.


[Bug middle-end/49721] convert_memory_address_addr_space may generate invalid new insns

2011-08-02 Thread ubizjak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49721

--- Comment #6 from Uros Bizjak  2011-08-02 15:39:55 
UTC ---
(In reply to comment #5)
> Another testcase:

Program received signal SIGSEGV, Segmentation fault.
try_combine (i3=, i2=, i1=0x0, i0=, new_direct_jump_p=0x7fffdf54, 
last_combined_insn=0x71a12c60) at
../../gcc-svn/trunk/gcc/combine.c:4154
4154  if (link->insn == i2)

#0  try_combine (i3=, i2=, i1=0x0, i0=, new_direct_jump_p=0x7fffdf54, 
last_combined_insn=0x71a12c60) at
../../gcc-svn/trunk/gcc/combine.c:4154
#1  0x00d3192d in combine_instructions (nregs=,
f=0x71a01048) at ../../gcc-svn/trunk/gcc/combine.c:1223
#2  rest_of_handle_combine () at ../../gcc-svn/trunk/gcc/combine.c:13880
#3  0x00871d88 in execute_one_pass (pass=0x13d2620) at
../../gcc-svn/trunk/gcc/passes.c:2063
#4  0x008720f5 in execute_pass_list (pass=0x13d2620) at
../../gcc-svn/trunk/gcc/passes.c:2118
#5  0x00872107 in execute_pass_list (pass=0x13cdc80) at
../../gcc-svn/trunk/gcc/passes.c:2119
#6  0x009752ce in tree_rest_of_compilation (fndecl=0x71b8cb00) at
../../gcc-svn/trunk/gcc/tree-optimize.c:416
#7  0x0065c8c6 in cgraph_expand_function (node=0x71991900) at
../../gcc-svn/trunk/gcc/cgraphunit.c:1803
#8  0x0065e64c in cgraph_expand_all_functions () at
../../gcc-svn/trunk/gcc/cgraphunit.c:1862


[Bug c++/49260] [C++0x] lambda-eh2.C fails execution

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49260

--- Comment #10 from Jason Merrill  2011-08-02 
15:35:28 UTC ---
Author: jason
Date: Tue Aug  2 15:35:20 2011
New Revision: 177186

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177186
Log:
PR c++/49260
* call.c (build_call_a): Set cp_function_chain->can_throw here.
(build_cxx_call): Not here.

Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/call.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C


[Bug c++/49924] [C++0X] [constexpr] can't initialize a non-static member array of a literal type as a constexpr

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49924

--- Comment #2 from Jason Merrill  2011-08-02 
15:35:38 UTC ---
Author: jason
Date: Tue Aug  2 15:35:34 2011
New Revision: 177188

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177188
Log:
PR c++/49924
* semantics.c (cxx_eval_vec_init_1): Fix logic.

Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/semantics.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug c++/49924] [C++0X] [constexpr] can't initialize a non-static member array of a literal type as a constexpr

2011-08-02 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49924

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.6.2

--- Comment #3 from Jason Merrill  2011-08-02 
15:37:15 UTC ---
Fixed for 4.6.2.


[Bug rtl-optimization/49941] [4.7 Regression] segmentation fault in redirect_jump_2

2011-08-02 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49941

--- Comment #2 from Alan Modra  2011-08-02 15:29:57 
UTC ---
So, rebuild_jump_labels doesn't add back this JUMP_LABEL, because
mark_jump_label does as its comment says:
   If INSN is a JUMP_INSN and there is at least one
   CODE_LABEL referenced in INSN as a jump target, then store the last
   one in JUMP_LABEL (INSN).

and we have ret_rtx here in the JUMP_LABEL, not a CODE_LABEL.


  1   2   >