[Bug c++/53661] [gcc-4.7/4.8 regression] Wrong narrowing conversion warning with -std=c++11

2012-09-14 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53661

--- Comment #4 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-09-14 
06:05:09 UTC ---
(In reply to comment #2)
 Manuel, what do you think about this? I see the warning happening because the
 underlying type of Code is unsigned int.

Isn't this a warning mandated by the standard?


[Bug c/54559] [4.7/4.8 Regression], ICE in gimplify_expr, at gimplify.c:7592

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54559

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
06:11:50 UTC ---
Fixed.


[Bug bootstrap/52887] Bootstrap on AIX failure: Undefined symbol: .std::functionvoid (std::__regex::_PatternCursor const, std::__regex::_Results)::function(std::functionvoid (std::__regex::_Patte

2012-09-14 Thread joerg.rich...@pdv-fs.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52887

--- Comment #22 from Jörg Richter joerg.rich...@pdv-fs.de 2012-09-14 07:58:16 
UTC ---
I have reduced a real live case. But still using vector.

$ cat t.cc
#include vector
struct ClassicUpdate
{
ClassicUpdate();
};
typedef std::vectorClassicUpdate ClassicUpdates;
struct UpdateData
{
ClassicUpdates classicUpdates;

UpdateData( ClassicUpdates const classicUpdates )
  : classicUpdates( classicUpdates )
{}
};
int main()
{}

$ g++ -std=gnu++0x -o mm t.cc -save-temps

$ grep Construct.*ClassicUpdate *.s
.weak   _ZSt10_ConstructI13ClassicUpdateIRKS0_EEvPT_DpOT0_[DS]
  ...

This should demostrate that GCC compiles a symbol referencing ClassicUpdate
into the executable. When the AIX linker decides to use that symbol you get 
an undefined reference error. This is not the case here. But the unreduced 
source has the problem.

GCC 4.6.3 doesn't do this. And removing -std=gnu++0x works too.

So it seems this is not regex-related but a deeper bug in GCC 4.7 that emits 
functions that are never called.


[Bug fortran/54578] New: [OOP] -Wunused-function warnings for __copy functions

2012-09-14 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54578

 Bug #: 54578
   Summary: [OOP] -Wunused-function warnings for __copy functions
Classification: Unclassified
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: bur...@gcc.gnu.org


Compiling the test case at PR 46897 with -Wall shows the bogus warning:

warning: ‘__copy_component_parent_child_module_Child’ defined but not used
[-Wunused-function]


I wonder whether one should use !sym-attr.artificial to silence the warning
or whether some other approach is better.

See also similar warnings (but for user code, where the function is actually
used) at PR 54221.


[Bug c++/54575] ICE with std::vector::insert and -std=c++11

2012-09-14 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54575

--- Comment #1 from Richard Guenther rguenth at gcc dot gnu.org 2012-09-14 
08:34:52 UTC ---
I can't reproduce this.


[Bug middle-end/54571] Missed optimization converting between bit sets

2012-09-14 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54571

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-09-14
Version|unknown |4.8.0
 Ever Confirmed|0   |1

--- Comment #1 from Richard Guenther rguenth at gcc dot gnu.org 2012-09-14 
08:39:42 UTC ---
Confirmed.  The natural place to optimize this is the tree level phiopt pass.

  bb 2:
  _3 = x_2(D)  2;
  if (_3 != 0)
goto bb 3;
  else
goto bb 4;

  bb 3:
  y_5 = y_4(D) | 1;

  bb 4:
  # y_1 = PHI y_4(D)(2), y_5(3)

where we should handle

int f1(int x, int y, int d) { int tem; if ((tem = x  d)) y |= tem; return y; }

as well.  Yes, that's just y |= x  d, but it falls out naturally if the
transform is implemented in a generic enough way.


[Bug c++/53661] [gcc-4.7/4.8 regression] Wrong narrowing conversion warning with -std=c++11

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53661

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #5 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
09:37:00 UTC ---
Indeed, I think it is, unless something says that the underlying type must be
int, but I don't think how. I think this PR is invalid. Let's ask Jason, to be
safe.


[Bug libstdc++/54577] dequeT::erase() still takes iterator instead of const_iterator

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||jwakely.gcc at gmail dot
   ||com

--- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
09:41:04 UTC ---
Yes, yes, probably we should update the docs about this, it's a known issue,
true for the ordered containers too (when a const_iterator is actually !=
iterator)


[Bug libstdc++/54576] [4.8 Regression] random_device isn't protected by _GLIBCXX_USE_C99_STDINT_TR1

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54576

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE

--- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
09:44:23 UTC ---
Dup.

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


[Bug libstdc++/54451] c++11/random.cc build failure when _GLIBCXX_USE_C99_STDINT_TR1 is not defined in config.h

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54451

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #8 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
09:44:23 UTC ---
*** Bug 54576 has been marked as a duplicate of this bug. ***


[Bug c++/54575] [4.8 Regression] ICE with std::vector::insert and -std=c++11

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54575

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-09-14
   Target Milestone|--- |4.8.0
Summary|ICE with|[4.8 Regression] ICE with
   |std::vector::insert and |std::vector::insert and
   |-std=c++11  |-std=c++11
 Ever Confirmed|0   |1

--- Comment #2 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
10:11:43 UTC ---
I can. It seems a serious regression. Hopefully, it's just that in a SFINAE
context we aren't smoothly handling an error_mark_node.


[Bug c++/54575] [4.8 Regression] ICE with std::vector::insert and -std=c++11

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54575

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|unassigned at gcc dot   |paolo.carlini at oracle dot
   |gnu.org |com

--- Comment #3 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
10:42:58 UTC ---
I have a patch, the issue seems indeed simple as I suspected.

Wolfgang, can you figure out a simpler testcase? (Generally I don't like
including the whole vector in the C++ testsuite, it increases the coupling
between testsuite and library)


[Bug libstdc++/54576] [4.8 Regression] random_device isn't protected by _GLIBCXX_USE_C99_STDINT_TR1

2012-09-14 Thread hjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54576

--- Comment #2 from hjl at gcc dot gnu.org hjl at gcc dot gnu.org 2012-09-14 
11:42:00 UTC ---
Author: hjl
Date: Fri Sep 14 11:41:53 2012
New Revision: 191294

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191294
Log:
Check _GLIBCXX_USE_C99_STDINT_TR1 in random.cc

PR libstdc++/54576
* libstdc++-v3/src/c++11/random.cc: Check if
_GLIBCXX_USE_C99_STDINT_TR1 is defined.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/src/c++11/random.cc


[Bug libstdc++/54451] c++11/random.cc build failure when _GLIBCXX_USE_C99_STDINT_TR1 is not defined in config.h

2012-09-14 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54451

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

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

--- Comment #9 from H.J. Lu hjl.tools at gmail dot com 2012-09-14 11:44:20 
UTC ---
Fixed by

http://gcc.gnu.org/ml/gcc-bugs/2012-09/msg01086.html


[Bug c++/54575] [4.8 Regression] ICE with std::vector::insert and -std=c++11

2012-09-14 Thread bangerth at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54575

--- Comment #4 from Wolfgang Bangerth bangerth at gmail dot com 2012-09-14 
11:48:56 UTC ---
Would this do? ;-)
..
templatetypename _From, typename _To
struct is_convertible { static const bool value = true; };

templatebool struct enable_if   { };
template struct enable_iftrue { typedef int type; };

templatetypename _InIter
using _RequireInputIter
= typename enable_ifis_convertible_InIter,bool::value::type;

templatetypename _Tp struct X {
templatetypename _InputIterator,
 typename = _RequireInputIter_InputIterator
  void insert(_InputIterator) {}
};

templatetypename void foo() {
  Xint subdomain_indices;
  subdomain_indices.insert(0);
}
.


gcc -std=c++11 -c x.ii
x.ii: In function 'void foo()':
x.ii:13:7: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in strip_typedefs, at cp/tree.c:1215
   typename = _RequireInputIter_InputIterator
   ^
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.


[Bug c++/54575] [4.8 Regression] ICE with std::vector::insert and -std=c++11

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54575

--- Comment #5 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
12:00:21 UTC ---
Fantastic, thanks!


[Bug target/54564] [4.8 Regression] Broken __builtin_ia32_vfmadds[sd]3

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54564

--- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
12:16:59 UTC ---
H.J., could you please review the fmaintrin.h changes of
http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00921.html
(Uros wanted your feedback on that).  Thanks.


[Bug tree-optimization/54565] pass_update_address_taken before forwprop1 for vectors

2012-09-14 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54565

--- Comment #3 from Richard Guenther rguenth at gcc dot gnu.org 2012-09-14 
12:22:33 UTC ---
Author: rguenth
Date: Fri Sep 14 12:22:27 2012
New Revision: 191295

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191295
Log:
2012-09-14  Richard Guenther  rguent...@suse.de

PR tree-optimization/54565
* passes.c (init_optimization_passes): Adjust comments.
(execute_function_todo): Do not execute execute_update_addresses_taken
before processing TODO_rebuild_alias.
* tree-ssa-ccp.c (do_ssa_ccp): Schedule TODO_update_address_taken.

* gcc.dg/tree-ssa/ssa-ccp-17.c: Adjust.
* gcc.dg/tree-ssa/forwprop-6.c: Likewise.  Remove XFAIL.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/passes.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c
trunk/gcc/tree-ssa-ccp.c


[Bug tree-optimization/54565] pass_update_address_taken before forwprop1 for vectors

2012-09-14 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54565

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #4 from Richard Guenther rguenth at gcc dot gnu.org 2012-09-14 
12:33:41 UTC ---
Fixed (in case you have a testcase feel free to add it).


[Bug target/54564] [4.8 Regression] Broken __builtin_ia32_vfmadds[sd]3

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54564

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
12:36:41 UTC ---
Author: jakub
Date: Fri Sep 14 12:36:33 2012
New Revision: 191297

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191297
Log:
PR target/54564
* config/i386/sse.md (fmai_vmfmadd_mode): Use (match_dup 1)
instead of (match_dup 0) as second argument to vec_merge.
(*fmai_fmadd_mode, *fmai_fmsub_mode): Likewise.
Remove third alternative.
(*fmai_fnmadd_mode, *fmai_fnmsub_mode): Likewise.  Negate
operand 2 instead of operand 1, but put it as first argument
of fma.

* config/i386/fmaintrin.h (_mm_fnmadd_sd, _mm_fnmadd_ss,
_mm_fnmsub_sd, _mm_fnmsub_ss): Negate the second argument instead
of the first.

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


[Bug target/54564] [4.8 Regression] Broken __builtin_ia32_vfmadds[sd]3

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54564

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
12:36:41 UTC ---
Author: jakub
Date: Fri Sep 14 12:36:33 2012
New Revision: 191297

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191297
Log:
PR target/54564
* config/i386/sse.md (fmai_vmfmadd_mode): Use (match_dup 1)
instead of (match_dup 0) as second argument to vec_merge.
(*fmai_fmadd_mode, *fmai_fmsub_mode): Likewise.
Remove third alternative.
(*fmai_fnmadd_mode, *fmai_fnmsub_mode): Likewise.  Negate
operand 2 instead of operand 1, but put it as first argument
of fma.

* config/i386/fmaintrin.h (_mm_fnmadd_sd, _mm_fnmadd_ss,
_mm_fnmsub_sd, _mm_fnmsub_ss): Negate the second argument instead
of the first.

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

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
12:37:32 UTC ---
Author: jakub
Date: Fri Sep 14 12:37:16 2012
New Revision: 191298

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191298
Log:
PR target/54564
* config/i386/sse.md (fmai_vmfmadd_mode): Use (match_dup 1)
instead of (match_dup 0) as second argument to vec_merge.
(*fmai_fmadd_mode, *fmai_fmsub_mode): Likewise.
Remove third alternative.
(*fmai_fnmadd_mode, *fmai_fnmsub_mode): Likewise.  Negate
operand 2 instead of operand 1, but put it as first argument
of fma.

* config/i386/fmaintrin.h (_mm_fnmadd_sd, _mm_fnmadd_ss,
_mm_fnmsub_sd, _mm_fnmsub_ss): Negate the second argument instead
of the first.

Modified:
trunk/gcc/config/i386/fmaintrin.h
trunk/gcc/config/i386/sse.md


[Bug target/54564] [4.8 Regression] Broken __builtin_ia32_vfmadds[sd]3

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54564

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
12:37:32 UTC ---
Author: jakub
Date: Fri Sep 14 12:37:16 2012
New Revision: 191298

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191298
Log:
PR target/54564
* config/i386/sse.md (fmai_vmfmadd_mode): Use (match_dup 1)
instead of (match_dup 0) as second argument to vec_merge.
(*fmai_fmadd_mode, *fmai_fmsub_mode): Likewise.
Remove third alternative.
(*fmai_fnmadd_mode, *fmai_fnmsub_mode): Likewise.  Negate
operand 2 instead of operand 1, but put it as first argument
of fma.

* config/i386/fmaintrin.h (_mm_fnmadd_sd, _mm_fnmadd_ss,
_mm_fnmsub_sd, _mm_fnmsub_ss): Negate the second argument instead
of the first.

Modified:
trunk/gcc/config/i386/fmaintrin.h
trunk/gcc/config/i386/sse.md


[Bug target/54564] [4.8 Regression] Broken __builtin_ia32_vfmadds[sd]3

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54564

--- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
12:40:37 UTC ---
Fixed on trunk, backport also tested on the 4.7 branch, but as 4.7.2-rc1 is in
the works, I'll defer it for after 4.7.2 is released.


[Bug tree-optimization/54565] pass_update_address_taken before forwprop1 for vectors

2012-09-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54565

--- Comment #5 from Marc Glisse glisse at gcc dot gnu.org 2012-09-14 12:44:33 
UTC ---
(In reply to comment #4)
 Fixed

Thank you.

 (in case you have a testcase feel free to add it).

Mostly I could tweak the last forwprop-xx.c tests to dump an earlier tree than
forwprop2 or optimized as they currently do. I'll try that later.


[Bug target/54546] SH: Enable -fshrink-wrap

2012-09-14 Thread chrbr at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54546

--- Comment #2 from chrbr at gcc dot gnu.org 2012-09-14 13:22:34 UTC ---
Author: chrbr
Date: Fri Sep 14 13:22:29 2012
New Revision: 191301

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191301
Log:
   PR target/54546
   * config/sh/sh-protos.h (sh_need_epilogue): Delete.
   (sh_can_use_simple_return_p): Declare.
   * config/sh/sh.c (sh_can_use_simple_return_p): Define.
   (sh_need_epilogue, sh_need_epilogue_known): Delete.
   (sh_output_function_epilogue): Remove sh_need_epilogue_known.
   * config/sh/sh.md (simple_return, return): Define.
   (epilogue): Use inline return rtl.
   (sh_expand_epilogue): Cleanup parameters boolean type.
   * config/sh/iterators.md (any_return): New iterator.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/iterators.md
trunk/gcc/config/sh/sh-protos.h
trunk/gcc/config/sh/sh.c
trunk/gcc/config/sh/sh.md


[Bug rtl-optimization/44194] struct returned by value generates useless stores

2012-09-14 Thread ebotcazou at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44194

--- Comment #46 from Eric Botcazou ebotcazou at gcc dot gnu.org 2012-09-14 
13:28:52 UTC ---
Author: ebotcazou
Date: Fri Sep 14 13:28:44 2012
New Revision: 191302

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191302
Log:
PR rtl-optimization/44194
* calls.c (expand_call): In the PARALLEL case, copy the return value
into pseudos instead of spilling it onto the stack.
* emit-rtl.c (adjust_address_1): Rename ADJUST into ADJUST_ADDRESS and
add new ADJUST_OBJECT parameter.
If ADJUST_OBJECT is set, drop the underlying object if it cannot be
proved that the adjusted memory access is still within its bounds.
(adjust_automodify_address_1): Adjust call to adjust_address_1.
(widen_memory_access): Likewise.
* expmed.c (store_bit_field_1): Call adjust_bitfield_address instead
of adjust_address.  Do not drop the underlying object of a MEM.
(store_fixed_bit_field): Likewise.
(extract_bit_field_1): Likewise.  Fix oversight in recursion.
(extract_fixed_bit_field): Likewise.
* expr.h (adjust_address_1): Adjust prototype.
(adjust_address): Adjust call to adjust_address_1.
(adjust_address_nv): Likewise.
(adjust_bitfield_address): New macro.
(adjust_bitfield_address_nv): Likewise.
* expr.c (expand_assignment): Handle a PARALLEL in more cases.
(store_expr): Likewise.
(store_field): Likewise.

* dse.c: Fix typos in the head comment.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/calls.c
trunk/gcc/dse.c
trunk/gcc/emit-rtl.c
trunk/gcc/expmed.c
trunk/gcc/expr.c
trunk/gcc/expr.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr44194-1.c


[Bug tree-optimization/54579] New: missed optimization: ASR idiom

2012-09-14 Thread rearnsha at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54579

 Bug #: 54579
   Summary: missed optimization: ASR idiom
Classification: Unclassified
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: rearn...@gcc.gnu.org


The idiom

int asr(int a, int b)
{
  return a  0 ? -(-a - 1  b) - 1 : a  b;
}

is equivalent to a portable form of arithmetic right shift.  However, at -O2
GCC currently generates something like

cmp r0, #0
mvnlt   r0, r0
mvnlt   r0, r0, asr r1
movge   r0, r0, asr r1

on ARM, or

testl   %edi, %edi
movl%esi, %ecx
js  .L7
movl%edi, %eax
sarl%cl, %eax
ret
.p2align 4,,7
.L7:
movl%edi, %eax
notl%eax
sarl%cl, %eax
notl%eax
ret

on x86.

On ARM this should just be:

asr r0, r0, r1


[Bug rtl-optimization/44194] struct returned by value generates useless stores

2012-09-14 Thread ebotcazou at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44194

Eric Botcazou ebotcazou at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #47 from Eric Botcazou ebotcazou at gcc dot gnu.org 2012-09-14 
13:37:40 UTC ---
At long last.


[Bug bootstrap/44959] [4.6 Regression] bootstrap failed at Comparing stages 2 and 3

2012-09-14 Thread ro at CeBiTec dot Uni-Bielefeld.DE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44959

--- Comment #33 from ro at CeBiTec dot Uni-Bielefeld.DE ro at CeBiTec dot 
Uni-Bielefeld.DE 2012-09-14 13:42:44 UTC ---
 --- Comment #26 from Hin-Tak Leung htl10 at users dot sourceforge.net
 2012-08-30 14:19:16 UTC ---
 (In reply to comment #22)
 snipped
 The sentence about newer versions is there for a reason.  In fact, on
 Tru64 UNIX the situation is even worse: gmp 4.3.2 make check fails for
 me, so I'm currently staying with gmp 4.2.1, mpfr 2.3.2, and mpc 0.8.
 
 Before using *any* version of gmp/mpfr/mpc with gcc (or for any other
 purpose), make sure that they pass make check, as prominently stated in
 e.g. the gmp announcements.
 
 Rainer

 You are quite right about that - 'make check' is okay for me for gmp 4.x and
 5.x, but mpfr 3.1.x fails (3.0.x and 2.4.x okay), mpc 0.8  1.0 are okay *if*
 mpfr is reverted back to 3.0.x .

I've no idea why gmp 4.3.x or 5.x works for you: both fail make check
for me if built with gcc 4.4.2.  I've not yet tried newer versions.

Rainer


[Bug bootstrap/44959] [4.6 Regression] bootstrap failed at Comparing stages 2 and 3

2012-09-14 Thread ro at CeBiTec dot Uni-Bielefeld.DE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44959

--- Comment #34 from ro at CeBiTec dot Uni-Bielefeld.DE ro at CeBiTec dot 
Uni-Bielefeld.DE 2012-09-14 13:44:22 UTC ---
 --- Comment #27 from Hin-Tak Leung htl10 at users dot sourceforge.net
 2012-08-30 14:56:46 UTC ---
 FWIW, I just filed the MFPR 3.1.x make check issue:

 https://gforge.inria.fr/tracker/index.php?func=detailaid=14806group_id=136atid=619

Thanks for doing this.  I might retry gmp 3.1.1 with current gcc since
at least one TLS bug was fixed there.

I didn't bother checking mpfr once I noticed that even current gmp
versions don't work correctly.

Rainer


[Bug c++/53661] [gcc-4.7/4.8 regression] Wrong narrowing conversion warning with -std=c++11

2012-09-14 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53661

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2012-09-14
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #6 from Jason Merrill jason at gcc dot gnu.org 2012-09-14 
13:46:12 UTC ---
This is a bug.  The values of Code (as per 7.2p7) are { 0, 1 }, and int can
represent both values, so the conversion is not a narrowing conversion.


[Bug c++/53661] [gcc-4.7/4.8 regression] Wrong narrowing conversion warning with -std=c++11

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53661

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC|jason at gcc dot gnu.org|

--- Comment #7 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
13:49:00 UTC ---
Ah, ah, I see, thanks.


[Bug bootstrap/44959] [4.6 Regression] bootstrap failed at Comparing stages 2 and 3

2012-09-14 Thread ro at CeBiTec dot Uni-Bielefeld.DE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44959

--- Comment #35 from ro at CeBiTec dot Uni-Bielefeld.DE ro at CeBiTec dot 
Uni-Bielefeld.DE 2012-09-14 13:49:28 UTC ---
 --- Comment #28 from Hin-Tak Leung htl10 at users dot sourceforge.net
 2012-08-30 17:32:35 UTC ---
 (In reply to comment #22)

  There are two curious things:
  1. why does the 2nd stage drops to only about 600 byte. (I assume 20-30k is
  normal).
 
 That's certainly completely unexpected.  I'd ask you to rebuild
 cc1-checksum.o for stage2 and stage3 (move the .o's aside, run make -n
 cc1-checksum.o, then manually add -v -save-temps to the compilation
 line.  Then attach a tarball with the .c and output files and the gcc -v
 output to see if there are any obvious diffences between the compilations.

 *.c is the same - the difference in size comes from -gtoggle (added to stage
 2).

You never mentioned -gtoggle before.  It seems you are using
--with-build-config=bootstrap-debug, correct?  If you report a problem,
*please* provide *all* the necessary information about your build, which
includes exact configure options used.

Instead of retrying with each and every gcc release, it's much more
useful to stay with a single one that fails and investigate that in
detail.  Unfortunately, you never provided the exact command lines used
to build the differing stage2 and 3 object files I've requested some
time ago.  This way, the difference would have been immediately
obvious instead of running in circles for weeks.

Rainer


[Bug bootstrap/44959] [4.6 Regression] bootstrap failed at Comparing stages 2 and 3

2012-09-14 Thread ro at CeBiTec dot Uni-Bielefeld.DE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44959

--- Comment #36 from ro at CeBiTec dot Uni-Bielefeld.DE ro at CeBiTec dot 
Uni-Bielefeld.DE 2012-09-14 13:51:58 UTC ---
 --- Comment #30 from Hin-Tak Leung htl10 at users dot sourceforge.net
 2012-09-01 08:18:06 UTC ---
 I commented out gcc-4.7.1/config/bootstrap-debug.mk :

 #STAGE2_CFLAGS += -gtoggle

 and 4.7.1 passed.

 this seems likely the cause - -gtoogle was introduced in 4.5.x. I am going to
 try going backwards to see whether this will have the older versions pass.

config/bootstrap-debug.mk isn't used by default, you need to enable it
with --with-build-config.

 Two curiosity:
 - how did I get 4.6.1 to pass, once?

No idea, perhaps you `forgot' to enable bootstrap-debug.mk?

 - why Rainer's system isn't similiarly affected?

Because I'm using default configure options as far as possible, as I had
suggested to you several times: start with the basics and if this works,
continue from there.

Rainer


[Bug bootstrap/44959] [4.6 Regression] bootstrap failed at Comparing stages 2 and 3

2012-09-14 Thread ro at CeBiTec dot Uni-Bielefeld.DE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44959

--- Comment #37 from ro at CeBiTec dot Uni-Bielefeld.DE ro at CeBiTec dot 
Uni-Bielefeld.DE 2012-09-14 13:54:42 UTC ---
 --- Comment #32 from Hin-Tak Leung htl10 at users dot sourceforge.net
 2012-09-01 11:22:55 UTC ---
 Went back to 4.5.0 and commenting out '#STAGE2_CFLAGS += -gtoggle' in
 config/bootstrap-debug.mk have it going beyond stage2/3 comparison. So I don't
 know how I managed to build 4.6.1 once
 (http://gcc.gnu.org/ml/gcc-testresults/2011-08/msg00587.html).

 I'll just go back and try every one of them with that mod, and run 'make -k
 check' afterwards.

Please forget about gcc 4.5.x: I don't test that branch any longer, so
even if you find something useful, it's almost guaranteed that I won't
touch that branch.

 -gtoggle seems to do more than just toggling -g - after strip'ing, the
 objects still differ by an extra text section in one of them. (anybody can 
 have
 a look at the attached tarballs of object files in this report).

If you had mentioned -gtoggle previously, you'd have saved all of us a
long useless hunt: different object files with and without -gtoggle can
easily be reproduced with a trivial source file.

I'll try to have a look what's going on.

Rainer


[Bug middle-end/52890] Revision 185336 causes 10% degradation on cpu2000 benchmark 252.eon

2012-09-14 Thread jamborm at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52890

--- Comment #11 from Martin Jambor jamborm at gcc dot gnu.org 2012-09-14 
13:55:04 UTC ---
(In reply to comment #10)
 
 Martin,
   Have you done any more digging on this? I just discovered that cpu2006
 benchmark 471.omnetpp suffers the same problem (8 byte loads turned in to
 sequence of byte loads/shifts/ors). It causes a 12% degradation on PowerPC, 
 and
 also goes away when -fno-ipa-sra is added. I'm attaching a reduced testcase
 that can be compiled with g++ -S -O3 -m64 -mcpu=power7.

Thanks for the reduced testcase.  This PR is still on my radar but so
far other issues have had higher priority.  On the other hand, I agree
I have not looked at this for too long, I'll do my best to look at it
soon.  I can't promise much in the next 2-3 weeks, though.


[Bug tree-optimization/54579] missed optimization: ASR idiom

2012-09-14 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54579

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-09-14
 CC||areg.melikadamyan at gmail
   ||dot com, hjl.tools at gmail
   ||dot com
 Ever Confirmed|0   |1

--- Comment #1 from H.J. Lu hjl.tools at gmail dot com 2012-09-14 14:06:43 
UTC ---
Clang generates:

movb%sil, %cl
sarl%cl, %edi
movl%edi, %eax
ret


[Bug c++/53661] [gcc-4.7/4.8 regression] Wrong narrowing conversion warning with -std=c++11

2012-09-14 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53661

--- Comment #8 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-09-14 
14:07:21 UTC ---
Wconversion does not warn either, but it also does not warn for:

enum Code {
  SUCCESS=-1
};

Code a;
void foo(void)
{
  unsigned int r;
  r = a;
}

Perhaps the code for handling this could be shared between Wconversion and
Wnarrowing (they warn in different cases but finding out these cases probably
requires similar code).


[Bug bootstrap/44959] [4.6 Regression] bootstrap failed at Comparing stages 2 and 3

2012-09-14 Thread htl10 at users dot sourceforge.net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44959

--- Comment #38 from Hin-Tak Leung htl10 at users dot sourceforge.net 
2012-09-14 14:43:00 UTC ---
(In reply to comment #33)
 I've no idea why gmp 4.3.x or 5.x works for you: both fail make check
 for me if built with gcc 4.4.2.  I've not yet tried newer versions.

probably slightly different cpu/system - you have a alphaev67-dec-osf5.1b or
something else instead of alphaev68-dec-osf5.1a, I believe? That probably also
explains the slight difference with gmp. 

BTW, the mfpr author closed the mfpr bug report as 'not his problem', because
he had documented that TLS does not work on 'some systems'. Maybe this should
be added to the platform-specific section of gcc's build docs?

(In reply to comment #36)
 config/bootstrap-debug.mk isn't used by default, you need to enable it
 with --with-build-config.

I have not don't anything special - just plain configure . it is the default,
and -gtoggle was newly added to 4.5.x . It is possible that I might have
accidentally set CFLAGS or something, in which case it would by-pass that and
use config/bootstrap-O1.mk , etc, I seem to read from the docs.

(In reply to comment #37)
 If you had mentioned -gtoggle previously, you'd have saved all of us a
 long useless hunt: different object files with and without -gtoggle can
 easily be reproduced with a trivial source file.

1. you advice did not work - moving the object files aside and re-run make does
not regenerate the earlier stage object file.

2. it is a remote system behind a firewall and I had not been saving the make
output, until they changed the remote-login time-outs and made me do 'nohup
make ' instead.

3. As I wrote, -gtoggle was added and enabled in 4.5.x+ new. I looked
elsewhere, it appeared that it also broke Mac OS X bootstrap briefly also - but
of course, that's a far-more common system and got fixed right away... If I
knew what to look for, of course I'd have written earlier. the benefit of
hind-sight.

Anyway, I have re-run all(?) of 4.4+ wit 'configure  make', and a few
selected ones with 'configure  make bootstrap4-lean' (it takes about 5-6
hours for that, and down to about 2 with -j3), but 'make -k check' takes longer
(9-10 hours and -jX runs in never-ending circles, it appears). There are minor
differences in some cases - about 3 tests. I'll post them to the testsuite
mailing list to be archived eventually.


[Bug middle-end/54315] Unnecessary copy of return value

2012-09-14 Thread ebotcazou at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54315

Eric Botcazou ebotcazou at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-09-14
 CC||ebotcazou at gcc dot
   ||gnu.org
 Ever Confirmed|0   |1

--- Comment #3 from Eric Botcazou ebotcazou at gcc dot gnu.org 2012-09-14 
14:54:53 UTC ---
The big discrepancy between structures and unions comes from:

/* Compute the TYPE_MODE for the TYPE (which is a RECORD_TYPE).  */

void
compute_record_mode (tree type)
{
[...]

  /* If we only have one real field; use its mode if that mode's size
 matches the type's size.  This only applies to RECORD_TYPE.  This
 does not apply to unions.  */
  if (TREE_CODE (type) == RECORD_TYPE  mode != VOIDmode
   host_integerp (TYPE_SIZE (type), 1)
   GET_MODE_BITSIZE (mode) == TREE_INT_CST_LOW (TYPE_SIZE (type)))
SET_TYPE_MODE (type, mode);
  else
SET_TYPE_MODE (type, mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1));

so the structure is given XFmode but the union is given BKLmode.

Apparently someone has attempted to bridge the gap but this was reverted by:


r37041 | wilson | 2000-10-25 03:30:25 +0200 (Wed, 25 Oct 2000) | 6 lines

Fixes for C++ structure layout breakage.
* expmed.c (store_bit_field): Move integer pun code down after
code that calls emit_move_insn for entire register move.
* stor-layout.c (compute_record_mode): Revert Mar 25, Aug 18, and
Oct 20 changes.  Only store mode in TYPE_MODE if RECORD_TYPE.


[Bug middle-end/54563] [4.7/4.8 Regression] ICE in redirect_eh_edge_1, at tree-eh.c:2215

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54563

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
15:41:48 UTC ---
Apple headers are broken then, powf isn't marked throw ().  Of course, we
shouldn't ICE on it though.


[Bug middle-end/54563] [4.7/4.8 Regression] ICE in redirect_eh_edge_1, at tree-eh.c:2215

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54563

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
16:17:38 UTC ---
I'd say the bug is somewhere on the C++ FE side, this is a
DEF_C99_C90_RES_BUILTIN, in -std=c++03 -O2 we don't ICE on it, but with -O2
(-std=gnu++03 or -std=c++11 or -std=gnu++11) somehow it is marked as builtin,
but doesn't inherit throw () from the builtin.
IMHO that doesn't make sense.  Either it is not builtin and we therefore
shouldn't treat it as such, or it is builtin and then we should know that it
never throws.
Sure, tree-ssa-math-opts.c could have added lots of
maybe_clean_or_replace_eh_stmt and gimple_purge_all_dead_eh_edges calls just in
case or give up optimizing if the calls can throw, but none of those builtins
really ever throw, so my preference would be to fix this there.  Jason?


[Bug c++/54580] New: 64-bit pointer to int cast fails

2012-09-14 Thread russell.wallace at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54580

 Bug #: 54580
   Summary: 64-bit pointer to int cast fails
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: russell.wall...@gmail.com


int main() { return (int); }

a.cc: In function 'int main()':
a.cc:1:26: error: cast from 'const char*' to 'int' loses precision
[-fpermissive]

This should not be a warning let alone an error, because an explicit cast was
used (though it would do no harm to retain it as a warning under -Wextra if so
desired).

Note that the -fpermissive workaround suggested in the message won't be a
solution in all cases because this is going to trigger on code that was
originally written - along with its build scripts - on 32-bit systems; in many
cases the author of the code will no longer be available to fix the problem.

Using built-in specs.
COLLECT_GCC=x86_64-w64-mingw32-g++
COLLECT_LTO_WRAPPER=c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../build/gcc/src/configure --target=x86_64-w64-mingw32
--prefix=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root
--with-sysroot=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root
--enable-languages=all,obj-c++ --enable-fully-dynamic-string --disable-multilib
Thread model: win32
gcc version 4.7.0 20111220 (experimental) (GCC)


[Bug c++/54575] [4.8 Regression] ICE with std::vector::insert and -std=c++11

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54575

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||hjl at gcc dot gnu.org

--- Comment #6 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
16:26:32 UTC ---
H.J. can you find when we started ICEing for the testcase in Comment 4?


[Bug c++/53661] [gcc-4.7/4.8 regression] Wrong narrowing conversion warning with -std=c++11

2012-09-14 Thread harald at gigawatt dot nl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53661

Harald van Dijk harald at gigawatt dot nl changed:

   What|Removed |Added

 CC||harald at gigawatt dot nl

--- Comment #9 from Harald van Dijk harald at gigawatt dot nl 2012-09-14 
16:28:40 UTC ---
Sorry for butting in, but is this really a bug?

7.2p5 says Each enumeration defines a type that is different from all other
types. Each enumeration also has an underlying type. The underlying type can be
explicitly specified using enum-base; if not explicitly specified, the
underlying type of a scoped enumeration type is int. In these cases, the
underlying type is said to be fixed.

This is an unscoped enumeration type without an enum-base, so the underlying
type is not fixed. 7.2p7 starts as For an enumeration whose underlying type is
fixed,, so does not apply. 7.2p6 does apply, but the relevant text of 7.2p7
that would make this code valid isn't present there.


[Bug c/54103] ICE at gimplify.c:7790 on current trunk

2012-09-14 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54103

--- Comment #1 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-09-14 
16:59:21 UTC ---
Author: jsm28
Date: Fri Sep 14 16:59:10 2012
New Revision: 191304

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191304
Log:
c:
PR c/54103
* c-typeck.c (build_unary_op): Pass original argument of
TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
any C_MAYBE_CONST_EXPR, if it has integer operands.
(build_binary_op): Pass original arguments of TRUTH_ANDIF_EXPR,
TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR
to c_objc_common_truthvalue_conversion, then remove any
C_MAYBE_CONST_EXPR, if they have integer operands.  Use
c_objc_common_truthvalue_conversion not
c_common_truthvalue_conversion.
(c_objc_common_truthvalue_conversion): Build NE_EXPR directly and
call note_integer_operands for arguments with integer operands
that are not integer constants.

testsuite:
* gcc.c-torture/compile/pr54103-1.c,
gcc.c-torture/compile/pr54103-2.c,
gcc.c-torture/compile/pr54103-3.c,
gcc.c-torture/compile/pr54103-4.c,
gcc.c-torture/compile/pr54103-5.c,
gcc.c-torture/compile/pr54103-6.c: New tests.
* gcc.dg/c90-const-expr-8.c: Update expected column number.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr54103-1.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr54103-2.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr54103-3.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr54103-4.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr54103-5.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr54103-6.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/c90-const-expr-8.c


[Bug c/54103] [4.6/4.7 Regression] ICE at gimplify.c:7790 on current trunk

2012-09-14 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54103

Joseph S. Myers jsm28 at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-09-14
   Target Milestone|--- |4.7.2
Summary|ICE at gimplify.c:7790 on   |[4.6/4.7 Regression] ICE at
   |current trunk   |gimplify.c:7790 on current
   ||trunk
 Ever Confirmed|0   |1

--- Comment #2 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-09-14 
17:02:00 UTC ---
Fixed so far for trunk, pending testing fix for 4.7 and 4.6.


[Bug c++/54580] 64-bit pointer to int cast fails

2012-09-14 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54580

--- Comment #1 from Andrew Pinski pinskia at gcc dot gnu.org 2012-09-14 
17:07:50 UTC ---
C++ is not C.


[Bug target/54516] [4.8 regression] ICE in reload_cse_simplify_operands, at postreload.c:403 with -O1 -march=armv7-a -mthumb

2012-09-14 Thread rearnsha at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54516

--- Comment #3 from Richard Earnshaw rearnsha at gcc dot gnu.org 2012-09-14 
17:10:53 UTC ---
Author: rearnsha
Date: Fri Sep 14 17:10:45 2012
New Revision: 191307

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191307
Log:
PR target/54516
PR rtl-optimization/54540
* reload.c (find_dummy_reload): Don't use OUT as a reload reg
for IN if it overlaps a fixed register.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/reload.c


[Bug rtl-optimization/54540] [4.8 regression] postreload incorrectly simplifies stack adjustment into constant load into SP

2012-09-14 Thread rearnsha at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54540

--- Comment #3 from Richard Earnshaw rearnsha at gcc dot gnu.org 2012-09-14 
17:10:53 UTC ---
Author: rearnsha
Date: Fri Sep 14 17:10:45 2012
New Revision: 191307

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191307
Log:
PR target/54516
PR rtl-optimization/54540
* reload.c (find_dummy_reload): Don't use OUT as a reload reg
for IN if it overlaps a fixed register.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/reload.c


[Bug c++/54427] Expose more vector extensions

2012-09-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54427

--- Comment #2 from Marc Glisse glisse at gcc dot gnu.org 2012-09-14 17:17:08 
UTC ---
Author: glisse
Date: Fri Sep 14 17:17:01 2012
New Revision: 191308

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191308
Log:
2012-09-14  Marc Glisse  marc.gli...@inria.fr
PR c++/54427

gcc/ChangeLog
* fold-const.c (fold_unary_loc): Disable for VECTOR_TYPE.
(fold_binary_loc): Likewise.
* gimple-fold.c (and_comparisons_1): Handle VECTOR_TYPE.
(or_comparisons_1): Likewise.

gcc/cp/ChangeLog
* typeck.c (cp_build_binary_op) [LSHIFT_EXPR, RSHIFT_EXPR, EQ_EXPR,
NE_EXPR, LE_EXPR, GE_EXPR, LT_EXPR, GT_EXPR]: Handle VECTOR_TYPE.

gcc/testsuite/ChangeLog
* g++.dg/other/vector-compare.C: New testcase.
* gcc/testsuite/c-c++-common/vector-compare-3.c: New testcase.
* gcc.dg/vector-shift.c: Move ...
* c-c++-common/vector-shift.c: ... here.
* gcc.dg/vector-shift1.c: Move ...
* c-c++-common/vector-shift1.c: ... here.
* gcc.dg/vector-shift3.c: Move ...
* c-c++-common/vector-shift3.c: ... here.
* gcc.dg/vector-compare-1.c: Move ...
* c-c++-common/vector-compare-1.c: ... here.
* gcc.dg/vector-compare-2.c: Move ...
* c-c++-common/vector-compare-2.c: ... here.
* gcc.c-torture/execute/vector-compare-1.c: Move ...
* c-c++-common/torture/vector-compare-1.c: ... here.
* gcc.c-torture/execute/vector-compare-2.x: Delete.
* gcc.c-torture/execute/vector-compare-2.c: Move ...
* c-c++-common/torture/vector-compare-2.c: ... here.
* gcc.c-torture/execute/vector-shift.c: Move ...
* c-c++-common/torture/vector-shift.c: ... here.
* gcc.c-torture/execute/vector-shift2.c: Move ...
* c-c++-common/torture/vector-shift2.c: ... here.
* gcc.c-torture/execute/vector-subscript-1.c: Move ...
* c-c++-common/torture/vector-subscript-1.c: ... here.
* gcc.c-torture/execute/vector-subscript-2.c: Move ...
* c-c++-common/torture/vector-subscript-2.c: ... here.
* gcc.c-torture/execute/vector-subscript-3.c: Move ...
* c-c++-common/torture/vector-subscript-3.c: ... here.


Added:
trunk/gcc/testsuite/c-c++-common/torture/vector-compare-1.c
  - copied, changed from r190838,
trunk/gcc/testsuite/gcc.c-torture/execute/vector-compare-1.c
trunk/gcc/testsuite/c-c++-common/torture/vector-compare-2.c
  - copied, changed from r190838,
trunk/gcc/testsuite/gcc.c-torture/execute/vector-compare-2.c
trunk/gcc/testsuite/c-c++-common/torture/vector-shift.c
  - copied, changed from r190838,
trunk/gcc/testsuite/gcc.c-torture/execute/vector-shift.c
trunk/gcc/testsuite/c-c++-common/torture/vector-shift2.c
  - copied, changed from r190838,
trunk/gcc/testsuite/gcc.c-torture/execute/vector-shift2.c
trunk/gcc/testsuite/c-c++-common/torture/vector-subscript-1.c
  - copied, changed from r190838,
trunk/gcc/testsuite/gcc.c-torture/execute/vector-subscript-1.c
trunk/gcc/testsuite/c-c++-common/torture/vector-subscript-2.c
  - copied, changed from r190838,
trunk/gcc/testsuite/gcc.c-torture/execute/vector-subscript-2.c
trunk/gcc/testsuite/c-c++-common/torture/vector-subscript-3.c
  - copied, changed from r190838,
trunk/gcc/testsuite/gcc.c-torture/execute/vector-subscript-3.c
trunk/gcc/testsuite/c-c++-common/vector-compare-1.c
  - copied, changed from r190834,
trunk/gcc/testsuite/gcc.dg/vector-compare-1.c
trunk/gcc/testsuite/c-c++-common/vector-compare-2.c
  - copied unchanged from r190834,
trunk/gcc/testsuite/gcc.dg/vector-compare-2.c
trunk/gcc/testsuite/c-c++-common/vector-compare-3.c   (with props)
trunk/gcc/testsuite/c-c++-common/vector-shift.c
  - copied, changed from r190834, trunk/gcc/testsuite/gcc.dg/vector-shift.c
trunk/gcc/testsuite/c-c++-common/vector-shift1.c
  - copied, changed from r190834,
trunk/gcc/testsuite/gcc.dg/vector-shift1.c
trunk/gcc/testsuite/c-c++-common/vector-shift3.c
  - copied, changed from r190834,
trunk/gcc/testsuite/gcc.dg/vector-shift3.c
trunk/gcc/testsuite/g++.dg/other/vector-compare.C   (with props)
Removed:
trunk/gcc/testsuite/gcc.c-torture/execute/vector-compare-1.c
trunk/gcc/testsuite/gcc.c-torture/execute/vector-compare-2.c
trunk/gcc/testsuite/gcc.c-torture/execute/vector-compare-2.x
trunk/gcc/testsuite/gcc.c-torture/execute/vector-shift.c
trunk/gcc/testsuite/gcc.c-torture/execute/vector-shift2.c
trunk/gcc/testsuite/gcc.c-torture/execute/vector-subscript-1.c
trunk/gcc/testsuite/gcc.c-torture/execute/vector-subscript-2.c
trunk/gcc/testsuite/gcc.c-torture/execute/vector-subscript-3.c
trunk/gcc/testsuite/gcc.dg/vector-compare-1.c
trunk/gcc/testsuite/gcc.dg/vector-compare-2.c
trunk/gcc/testsuite/gcc.dg/vector-shift.c
trunk/gcc/testsuite/gcc.dg/vector-shift1.c
trunk/gcc/testsuite/gcc.dg/vector-shift3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/fold-const.c

[Bug c++/54427] Expose more vector extensions

2012-09-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54427

--- Comment #3 from Marc Glisse glisse at gcc dot gnu.org 2012-09-14 17:22:24 
UTC ---
Progress :-)

Documentation update is needed.

Next useful one would be ?: so we can generate vec_cond_expr. See the OpenCL
specification for a list of what's missing.

Another useful thing would be to audit the optimization passes that don't
expect vectors and mishandle them...


[Bug rtl-optimization/44194] struct returned by value generates useless stores

2012-09-14 Thread chip at pobox dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44194

--- Comment #48 from Chip Salzenberg chip at pobox dot com 2012-09-14 
17:23:08 UTC ---
May Shub-Internet not see you as you pass.


[Bug c++/54575] [4.8 Regression] ICE with std::vector::insert and -std=c++11

2012-09-14 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54575

--- Comment #7 from H.J. Lu hjl.tools at gmail dot com 2012-09-14 17:38:07 
UTC ---
(In reply to comment #4)
 Would this do? ;-)
 ..
 templatetypename _From, typename _To
 struct is_convertible { static const bool value = true; };
 
 templatebool struct enable_if   { };
 template struct enable_iftrue { typedef int type; };
 
 templatetypename _InIter
 using _RequireInputIter
 = typename enable_ifis_convertible_InIter,bool::value::type;
 
 templatetypename _Tp struct X {
 templatetypename _InputIterator,
  typename = _RequireInputIter_InputIterator
   void insert(_InputIterator) {}
 };
 
 templatetypename void foo() {
   Xint subdomain_indices;
   subdomain_indices.insert(0);
 }
 .
 
 
 gcc -std=c++11 -c x.ii
 x.ii: In function 'void foo()':
 x.ii:13:7: internal compiler error: tree check: expected class 'type', have
 'exceptional' (error_mark) in strip_typedefs, at cp/tree.c:1215
typename = _RequireInputIter_InputIterator
^
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See http://gcc.gnu.org/bugs.html for instructions.

This is caused by revision 190830:

http://gcc.gnu.org/ml/gcc-cvs/2012-08/msg00808.html


[Bug c++/54581] New: decltype and opaque vector types

2012-09-14 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54581

 Bug #: 54581
   Summary: decltype and opaque vector types
Classification: Unclassified
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: gli...@gcc.gnu.org


As explained here:

http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01023.html

it would be nice if decltype could remove the opacity from vector types. In
particular:

typedef double vec __attribute__((vector_size(2*sizeof(double;
extern vec x;
decltype(xx) y={1,2};

should not complain.


[Bug c++/54575] [4.8 Regression] ICE with std::vector::insert and -std=c++11

2012-09-14 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54575

--- Comment #8 from Paolo Carlini paolo.carlini at oracle dot com 2012-09-14 
18:22:17 UTC ---
Ah, thanks!


[Bug middle-end/54563] [4.7/4.8 Regression] ICE in redirect_eh_edge_1, at tree-eh.c:2215

2012-09-14 Thread wschmidt at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54563

--- Comment #6 from William J. Schmidt wschmidt at gcc dot gnu.org 2012-09-14 
18:25:52 UTC ---
I tend to agree; this isn't the only place in the middle-end this could cause
trouble.  The handling of pow/powf in reassociation comes to mind as another
place where this could cause trouble.


[Bug middle-end/54563] [4.7/4.8 Regression] ICE in redirect_eh_edge_1, at tree-eh.c:2215

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54563

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
18:30:18 UTC ---
Seems the C++ FE ignores the nothrow attribute from builtins and instead just
uses its own cfns.gperf.  pow is in there, but powf/powl is not (as C++03 is
based in C90).  Even in C++11 powf/powl isn't considered throw().


[Bug middle-end/54563] [4.7/4.8 Regression] ICE in redirect_eh_edge_1, at tree-eh.c:2215

2012-09-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54563

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org 2012-09-14 
19:09:51 UTC ---
Created attachment 28192
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28192
gcc48-pr54563.patch

Actually it doesn't seem to be too hard to handle it in execute_cse_sincos, the
gsi_replace calls already pass true as last argument, so no need to call
maybe_cleanup_eh_stmt, just gimple_purge_dead_eh_edges needs to be called if
we've changed the last stmt in a bb.  Untested yet.


[Bug c/54582] New: gap in FORTIFY checking of buffer lengths

2012-09-14 Thread dcb314 at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54582

 Bug #: 54582
   Summary: gap in FORTIFY checking of buffer lengths
Classification: Unclassified
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: c
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: dcb...@hotmail.com


Consider the following code

# include stdio.h

void f(int n)
{
char buf[2];

sprintf(buf, ab%d, n);
printf(%s\n, buf);

sprintf(buf, ab);
printf(%s\n, buf);
}

int
main()
{
f(2);

return 0;
}

compiled as

[dcb@zippy Alphasrc]$ ~/gcc/trunk/results/bin/gcc -g -O2 -Wall
-D_FORTIFY_SOURCE=2 -c sep14a.c
In file included from /usr/include/stdio.h:936:0,
 from sep14a.c:2:
In function ‘sprintf’,
inlined from ‘f’ at sep14a.c:11:9:
/usr/include/bits/stdio2.h:34:3: warning: call to __builtin___sprintf_chk will
always overflow destination buffer [enabled by default]
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
   ^

so gcc can find the problem in the 2nd sprintf, but not the first.

All the numeric specifiers (%d, %u etc) all produce at least one 
character, so gcc could take account of this in checking buffer lengths.

Here is cppcheck finding the problem

Checking sep14a.c...
[sep14a.c:8]: (error) Buffer is accessed out of bounds.
[sep14a.c:11]: (error) Buffer is accessed out of bounds.


[Bug c++/54583] New: Spurious warning: value computed is not used with variable-size array

2012-09-14 Thread stuff0002 at pobox dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54583

 Bug #: 54583
   Summary: Spurious warning: value computed is not used with
variable-size array
Classification: Unclassified
   Product: gcc
   Version: 4.6.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: stuff0...@pobox.com


When declaring a two-dimensional array with variable-length second dimension,
there is a warning value computed is not used. For example:

$ cat warn1.cpp
void fred(){
  int n=10;
  double (*x)[n];
}
$ g++ -c warn1.cpp -Wall
warn1.cpp: In function ‘void fred()’:
warn1.cpp:3:16: warning: value computed is not used [-Wunused-value]
warn1.cpp:3:12: warning: unused variable ‘x’ [-Wunused-variable]

The second warning (unused variable) is to be expected of course, and is not
the subject of this bug report. I don't believe the fact that x isn't used is
relevant to the first warning, so code that uses x is omitted in the above
example in the interests of constructing a minimal example. But to check, here
is a longer example that uses x:

$ cat warn2.cpp
#include stdio.h
#include stdlib.h

#define M 10
void fred(){
  int a,b,n;
  n=10;
  double (*x)[n];
  x=(double(*)[n])malloc(M*n*sizeof(double));
  for(a=0;aM;a++)for(b=0;bn;b++)x[a][b]=3;
  for(a=0;aM;a++)for(b=0;bn;b++)printf(%g\n,x[a][b]);
}
$ g++ -c warn2.cpp -Wall
warn2.cpp: In function ‘void fred()’:
warn2.cpp:8:16: warning: value computed is not used [-Wunused-value]


g++ --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
...


[Bug target/54584] New: m68k-uclinux error: Link tests are not allowed after GCC_NO_EXECUTABLES

2012-09-14 Thread baker at usgs dot gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54584

 Bug #: 54584
   Summary: m68k-uclinux error: Link tests are not allowed after
GCC_NO_EXECUTABLES
Classification: Unclassified
   Product: gcc
   Version: 4.7.1
Status: UNCONFIRMED
  Severity: blocker
  Priority: P3
 Component: target
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ba...@usgs.gov


Created attachment 28193
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28193
Make m68k-uclinux-gcc/g++ cross compilers

Host: i686-pc-linux (also x86_64-apple-darwin10.8.0)
Target: m68k-uclinux (Coldfire)

Build of msep-data/libstdc++-v3 fails for FreeScale Coldfire uClinux target
(complete configure and build commands are attached):

:
Running configure in multilib subdir msep-data
:
checking command to parse
/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/nm output from
/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc
-B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/
-B/usr/local/gcc-4.7-20120908/m68k-uclinux/bin/
-B/usr/local/gcc-4.7-20120908/m68k-uclinux/lib/ -isystem
/usr/local/gcc-4.7-20120908/m68k-uclinux/include -isystem
/usr/local/gcc-4.7-20120908/m68k-uclinux/sys-include  -msep-data -Wa,-mno-mac
object... failed
:
checking for shl_load... configure: error: Link tests are not allowed after
GCC_NO_EXECUTABLES.
make[2]: *** [configure-target-libstdc++-v3] Error 1

In msep-data/libstdc++-v3/config.log there is an earlier link failure which
causes gcc_no_link=yes:

configure:3885: /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc
-B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/
-B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire-gcc-4.7-20120908/m68k-uclinux/bin/
-B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire-gcc-4.7-20120908/m68k-uclinux/lib/
-isystem
/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire-gcc-4.7-20120908/m68k-uclinux/include
-isystem
/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire-gcc-4.7-20120908/m68k-uclinux/sys-include
 -msep-data -Wa,-mno-mac -o conftest -g -O2   conftest.c  5
/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/bin/ld.real:
final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

configure:11284: checking for shl_load
configure:11284: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

I extracted the failed command and showed that the link fails for both
msep-data and -fPIC (implied by -msep-data):

$ cat conftest.c
/* confdefs.h */
#define PACKAGE_NAME package-unused
#define PACKAGE_TARNAME libstdc++
#define PACKAGE_VERSION version-unused
#define PACKAGE_STRING package-unused version-unused
#define PACKAGE_BUGREPORT 
#define PACKAGE_URL 
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}

# Failed link from libstdc++-v3/configure:
/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc -t
-B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/
-B/usr/local/gcc-4.7-20120908/m68k-uclinux/bin/
-B/usr/local/gcc-4.7-20120908/m68k-uclinux/lib/ -isystem
/usr/local/gcc-4.7-20120908/m68k-uclinux/include -isystem
/usr/local/gcc-4.7-20120908/m68k-uclinux/sys-include -msep-data -Wa,-mno-mac -o
conftest conftest.o
# /usr/local/gcc-4.7-20120908/m68k-uclinux/bin/ld.real: final link failed:
Nonrepresentable section on output
# collect2: error: ld returned 1 exit status

# The problem is actually with -fPIC (implied by -msep-data):
/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc -t
-B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/
-B/usr/local/gcc-4.7-20120908/m68k-uclinux/bin/
-B/usr/local/gcc-4.7-20120908/m68k-uclinux/lib/ -isystem
/usr/local/gcc-4.7-20120908/m68k-uclinux/include -isystem
/usr/local/gcc-4.7-20120908/m68k-uclinux/sys-include -fPIC -Wa,-mno-mac -o
conftest conftest.o
# /usr/local/gcc-4.7-20120908/m68k-uclinux/bin/ld.real: final link failed:
Nonrepresentable section on output
# collect2: error: ld returned 1 exit status

The link does not fail when the GCC 4.6 crtbegin.o/crtend.o binaries are used:

# Linking with the 4.6 crtbegin/crtend binaries makes the problem go away:
\mv cross-gcc-4.7-20120908/gcc/msep-data/crtbegin{,-4.7}.o
\mv cross-gcc-4.7-20120908/gcc/msep-data/crtend{,-4.7}.o
\cp cross-gcc-{4.6-20120907,4.7-20120908}/gcc/msep-data/crtbegin.o
\cp cross-gcc-{4.6-20120907,4.7-20120908}/gcc/msep-data/crtend.o

/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc -t
-B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/
-B/usr/local/gcc-4.7-20120908/m68k-uclinux/bin/
-B/usr/local/gcc-4.7-20120908/m68k-uclinux/lib/ -isystem
/usr/local/gcc-4.7-20120908/m68k-uclinux/include -isystem
/usr/local/gcc-4.7-20120908/m68k-uclinux/sys-include -msep-data -Wa,-mno-mac -o
conftest conftest.o

\mv 

[Bug target/28896] -fstack-limit-symbol and m68k and non 68020

2012-09-14 Thread baker at usgs dot gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28896

--- Comment #28 from Larry Baker baker at usgs dot gov 2012-09-14 20:52:14 
UTC ---
Created attachment 28194
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28194
Patch for trunk version 2012-09-09 of gcc/config/m68k/uclinux.h

To fix the same bug reported for GCC 4.7 at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54584.


[Bug gcov-profile/54487] [4.8 Regression] profiledbootstrap broken by r190952

2012-09-14 Thread tejohnson at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54487

--- Comment #32 from tejohnson at gcc dot gnu.org 2012-09-14 21:06:54 UTC ---
Author: tejohnson
Date: Fri Sep 14 21:06:49 2012
New Revision: 191312

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191312
Log:
Backport from trunk r190952 to add counter histogram to gcov program summary,
and follow-on fixes for PR gcov-profile/54487 (r191074 and r191238).

2012-09-14  Teresa Johnson  tejohn...@google.com

* libgcc/libgcov.c (gcov_histogram_insert): New function.
(gcov_compute_histogram): Ditto.
(sort_by_reverse_gcov_value): Remove function.
(gcov_compute_cutoff_values): Ditto.
(gcov_merge_gcda_file): Merge histogram while merging summary.
(gcov_gcda_file_size): Include histogram in summary size computation.
(gcov_write_gcda_file): Remove assert that is no longer valid.
(gcov_exit_init): Invoke gcov_compute_histogram.
* gcc/gcov-io.c (gcov_write_summary): Write out non-zero histogram
entries to function summary along with an occupancy bit vector.
(gcov_read_summary): Read in the histogram entries.
(gcov_histo_index): New function.
(gcov_histogram_merge): Ditto.
* gcc/gcov-io.h (gcov_type_unsigned): New type.
(struct gcov_bucket_type): Ditto.
(struct gcov_ctr_summary): Include histogram.
(GCOV_TAG_SUMMARY_LENGTH): Update to include histogram entries.
(GCOV_HISTOGRAM_SIZE): New macro.
(GCOV_HISTOGRAM_BITVECTOR_SIZE): Ditto.
(gcov_gcda_file_size): New parameter.
* gcc/profile.c (NUM_GCOV_WORKING_SETS): Ditto.
(gcov_working_sets): New global variable.
(compute_working_sets): New function.
(find_working_set): Ditto.
(get_exec_counts): Invoke compute_working_sets.
* gcc/loop-unroll.c (code_size_limit_factor): Call new function
find_working_set to obtain working set information.
* gcc/coverage.c (read_counts_file): Merge histograms, and
fix bug with accessing summary info for non-summable counters.
* gcc/basic-block.h (gcov_type_unsigned): New type.
(struct gcov_working_set_info): Ditto.
(find_working_set): Declare.
* gcc/gcov-dump.c (tag_summary): Dump out histogram.
* gcc/configure.ac (HOST_HAS_F_SETLKW): Set based on compile
test using F_SETLKW with fcntl.
* gcc/configure, gcc/config.in: Regenerate.

Modified:
branches/google/gcc-4_7/gcc/ChangeLog.google-4_7
branches/google/gcc-4_7/gcc/basic-block.h
branches/google/gcc-4_7/gcc/config.in
branches/google/gcc-4_7/gcc/configure
branches/google/gcc-4_7/gcc/configure.ac
branches/google/gcc-4_7/gcc/coverage.c
branches/google/gcc-4_7/gcc/gcov-dump.c
branches/google/gcc-4_7/gcc/gcov-io.c
branches/google/gcc-4_7/gcc/gcov-io.h
branches/google/gcc-4_7/gcc/loop-unroll.c
branches/google/gcc-4_7/gcc/profile.c
branches/google/gcc-4_7/libgcc/ChangeLog.google-4_7
branches/google/gcc-4_7/libgcc/libgcov.c


[Bug rtl-optimization/54585] New: stack space allocated but never used when calling functions that return structs in registers

2012-09-14 Thread chip at pobox dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54585

 Bug #: 54585
   Summary: stack space allocated but never used when calling
functions that return structs in registers
Classification: Unclassified
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: c...@pobox.com


Now that bug #44194 is fixed, and a returned structure used as a parameter is
no longer stored unnecessarily, a new bug is visible: a stack frame is being
allocated that is entirely unused.  On x86_64 target with the fix for 44194
backported to the 4.7 branch, this code:


#include stdint.h

struct blargh { uint32_t a, b, c; } foo();
void bar(uint32_t a, uint32_t b, uint32_t c);

void func() {
  struct blargh s = foo();
  bar(s.a, s.b, s.c);
}


no longer uses any stack memory at all, but still the function call reserves 24
bytes with subq $24,%rsp and promptly returns it with addq $24,%rsp.   The
generated code looks like this:

 func:
.cfi_startproc
xorl%eax, %eax
subq$24, %rsp
.cfi_def_cfa_offset 32
callfoo
movq%rax, %rsi
movl%eax, %edi
addq$24, %rsp
.cfi_def_cfa_offset 8
shrq$32, %rsi
jmp bar
.cfi_endproc


[Bug c/54552] [4.6/4.7/4.8 Regression] Cast to pointer to VLA crash the compiler

2012-09-14 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552

--- Comment #3 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-09-14 
21:17:00 UTC ---
Author: jsm28
Date: Fri Sep 14 21:16:56 2012
New Revision: 191313

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191313
Log:
c:
PR c/54552
* c-typeck.c (c_cast_expr): When casting to a type requiring
C_MAYBE_CONST_EXPR to be created, pass the inner expression to
c_fully_fold first.

testsuite:
* gcc.c-torture/compile/pr54552-1.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr54552-1.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog


[Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler

2012-09-14 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552

Joseph S. Myers jsm28 at gcc dot gnu.org changed:

   What|Removed |Added

Summary|[4.6/4.7/4.8 Regression]|[4.6/4.7 Regression] Cast
   |Cast to pointer to VLA  |to pointer to VLA crash the
   |crash the compiler  |compiler

--- Comment #4 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-09-14 
21:18:35 UTC ---
Fixed so far for trunk, pending testing fix for 4.7 and 4.6.


[Bug middle-end/52173] internal compiler error: verify_ssa failed possibly caused by itm

2012-09-14 Thread aldyh at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52173

--- Comment #8 from Aldy Hernandez aldyh at gcc dot gnu.org 2012-09-14 
21:20:23 UTC ---
Created attachment 28195
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28195
reduced testcase

Further reduced testcase that triggers on either C/C++.


[Bug bootstrap/38607] AIX error messages about TOC during build

2012-09-14 Thread dje at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38607

--- Comment #20 from David Edelsohn dje at gcc dot gnu.org 2012-09-14 
23:23:45 UTC ---
Author: dje
Date: Fri Sep 14 23:23:41 2012
New Revision: 191316

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191316
Log:
PR target/38607
Merge upstream change.
* libtool.m4 (_LT_COMPILER_PIC): Add -fPIC to GCC and GXX for AIX.

* configure.ac: Add target-libquadmath to noconfigdirs for AIX.
Add libgomp*.o to compare_exclusions for AIX.
* configure: Regenerate.

Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/libtool.m4


[Bug other/54586] New: Help diagnosing error: Link tests are not allowed after GCC_NO_EXECUTABLES

2012-09-14 Thread baker at usgs dot gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54586

 Bug #: 54586
   Summary: Help diagnosing error: Link tests are not allowed
after GCC_NO_EXECUTABLES
Classification: Unclassified
   Product: gcc
   Version: 4.7.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ba...@usgs.gov


This is not a bug report, but a feature request.

I have been struggling with building GCC cross compilers.  When I unexpectedly
encounter error: Link tests are not allowed after GCC_NO_EXECUTABLES, what I
really need to do is find out which previous configure step broke and set
gcc_no_link=yes.  The Link tests... error is a consequence of the true error,
which is not identified as having set gcc_no_link=yes.

I have taken to hand editing configure files when this happens and inserting my
own diagnostic output when either gcc_no_link=no or gcc_no_link=yes is
executed, e.g., in libiberty/configure:

# FIXME: Cleanup?
if { { eval echo \\$as_me\:${as_lineno-$LINENO}: \$ac_link\; } 5
  (eval $ac_link) 25
  ac_status=$?
  $as_echo $as_me:${as_lineno-$LINENO}: \$? = $ac_status 5
  test $ac_status = 0; }; then :

  $as_echo $as_me:${as_lineno-$LINENO}: --- gcc_no_link=no 5

  gcc_no_link=no
else

  $as_echo $as_me:${as_lineno-$LINENO}: --- gcc_no_link=yes 5

  gcc_no_link=yes
fi

It would be really useful if all GCC configure files would emit such a message,
at least when setting gcc_no_link=yes.  It would make it a lot easier to
trouble shoot Link tests... errors.


[Bug c/54103] [4.6/4.7 Regression] ICE at gimplify.c:7790 on current trunk

2012-09-14 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54103

--- Comment #3 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-09-15 
00:28:08 UTC ---
Author: jsm28
Date: Sat Sep 15 00:28:05 2012
New Revision: 191336

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191336
Log:
PR c/54103
* c-typeck.c (build_unary_op): Pass original argument of
TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
any C_MAYBE_CONST_EXPR, if it has integer operands.
(build_binary_op): Pass original arguments of TRUTH_ANDIF_EXPR,
TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR
to c_objc_common_truthvalue_conversion, then remove any
C_MAYBE_CONST_EXPR, if they have integer operands.  Use
c_objc_common_truthvalue_conversion not
c_common_truthvalue_conversion.
(c_objc_common_truthvalue_conversion): Build NE_EXPR directly and
call note_integer_operands for arguments with integer operands
that are not integer constants.

testsuite:
* gcc.c-torture/compile/pr54103-1.c,
gcc.c-torture/compile/pr54103-2.c,
gcc.c-torture/compile/pr54103-3.c,
gcc.c-torture/compile/pr54103-4.c,
gcc.c-torture/compile/pr54103-5.c,
gcc.c-torture/compile/pr54103-6.c: New tests.
* gcc.dg/c90-const-expr-8.c: Update expected column number.

Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-1.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-2.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-3.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-4.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-5.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-6.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/c-typeck.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/c90-const-expr-8.c


[Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler

2012-09-14 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552

--- Comment #5 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-09-15 
00:29:31 UTC ---
Author: jsm28
Date: Sat Sep 15 00:29:28 2012
New Revision: 191337

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=191337
Log:
PR c/54552
* c-typeck.c (c_cast_expr): When casting to a type requiring
C_MAYBE_CONST_EXPR to be created, pass the inner expression to
c_fully_fold first.

testsuite:
* gcc.c-torture/compile/pr54552-1.c: New test.

Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54552-1.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/c-typeck.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug c/54103] [4.7 Regression] ICE at gimplify.c:7790 on current trunk

2012-09-14 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54103

Joseph S. Myers jsm28 at gcc dot gnu.org changed:

   What|Removed |Added

Summary|[4.6/4.7 Regression] ICE at |[4.7 Regression] ICE at
   |gimplify.c:7790 on current  |gimplify.c:7790 on current
   |trunk   |trunk

--- Comment #4 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-09-15 
00:30:51 UTC ---
Fixed for 4.6.4, 4.7 branch fix to follow after 4.7.2 is released.


[Bug c/54552] [4.6/4.7 Regression] Cast to pointer to VLA crash the compiler

2012-09-14 Thread jsm28 at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54552

Joseph S. Myers jsm28 at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.6.4   |4.7.2

--- Comment #6 from Joseph S. Myers jsm28 at gcc dot gnu.org 2012-09-15 
00:31:49 UTC ---
Fixed for 4.6.4, 4.7 branch fix to follow after 4.7.2 is released.


[Bug target/54584] m68k-uclinux error: Link tests are not allowed after GCC_NO_EXECUTABLES

2012-09-14 Thread baker at usgs dot gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54584

--- Comment #1 from Larry Baker baker at usgs dot gov 2012-09-15 00:39:14 UTC 
---
I found that the -msep-data link would succeed if program section
.tm_clone_table has a non-zero length.

I changed __JCR_LIST__[] and __TMC_LIST__[] to __JCR_LIST__[1] and
__TMC_LIST__[1], respectively, in
gcc-4.7-20120908/libgcc/crtstuff.c.

The program sections in the original crtbegin.o have 0 length for program
section .tm_clone_table:

# freescale-coldfire-2011.09/bin/m68k-uclinux-objdump -h
cross-gcc-4.7-20120908/gcc/msep-data/crtbegin.o

cross-gcc-4.7-20120908/gcc/msep-data/crtbegin.o: file format elf32-m68k

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 0136      0034  2**2
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data 0004      016c  2**2
  CONTENTS, ALLOC, LOAD, DATA
  2 .bss  001e      0170  2**2
  ALLOC
  3 .ctors0004      0170  2**2
  CONTENTS, ALLOC, LOAD, DATA
  4 .dtors0004      0174  2**2
  CONTENTS, ALLOC, LOAD, DATA
  5 .eh_frame       0178  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .jcr        0178  2**2
  CONTENTS, ALLOC, LOAD, DATA
  7 .tm_clone_table       0178  2**2
  CONTENTS, ALLOC, LOAD, DATA
  8 .fini 0006      0178  2**0
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  9 .init 0006      017e  2**0
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
 10 .comment  0028      0184  2**0
  CONTENTS, READONLY
 11 .note.GNU-stack       01ac  2**0
  CONTENTS, READONLY

The new one has length 4:

# freescale-coldfire-2011.09/bin/m68k-uclinux-objdump -h
cross-gcc-4.7-20120908/gcc/msep-data/crtbegin.o

cross-gcc-4.7-20120908/gcc/msep-data/crtbegin.o: file format elf32-m68k

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 0136      0034  2**2
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data 0004      016c  2**2
  CONTENTS, ALLOC, LOAD, DATA
  2 .bss  001e      0170  2**2
  ALLOC
  3 .ctors0004      0170  2**2
  CONTENTS, ALLOC, LOAD, DATA
  4 .dtors0004      0174  2**2
  CONTENTS, ALLOC, LOAD, DATA
  5 .eh_frame       0178  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .jcr  0004      0178  2**2
  CONTENTS, ALLOC, LOAD, DATA
  7 .tm_clone_table 0004      017c  2**2
  CONTENTS, ALLOC, LOAD, DATA
  8 .fini 0006      0180  2**0
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  9 .init 0006      0186  2**0
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
 10 .comment  0028      018c  2**0
  CONTENTS, READONLY
 11 .note.GNU-stack       01b4  2**0
  CONTENTS, READONLY

I do not know if this results in a correctly allocated or populated
.tm_clone_table.  All I know is that the zero length allocation caused the link
failure.  Is this due to the ALLOC attribute with 0 length?  Is this a
consequence of __attribute__((used))?


[Bug target/28896] -fstack-limit-symbol and m68k and non 68020

2012-09-14 Thread baker at usgs dot gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28896

--- Comment #29 from Larry Baker baker at usgs dot gov 2012-09-15 05:41:24 
UTC ---
Created attachment 28196
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28196
Patches for Sourcery (Mentor Graphics) CodeBench Lite GCC 4.6-2011.09-23

Patches to fix stack limit checking for Sourcery (Mentor Graphics) CodeBench
Lite GCC 4.6-2011.09-23 for FreeScale Coldfire uClinux.