* builtins.c (fold_builtin_hypot): Rearrange recursive
transformation before others, and also do ABS_EXPR. When
necessary, check flag_unsafe_math_optimizations. When necessary,
add fabs.
testsuite:
* gcc.dg/builtins-20.c: Add more hypot tests.
From-SVN: r118160
2006-10-29 Paolo Carlini <pcarlini@suse.de>
* src/debug.cc (_Safe_sequence_base::_M_revalidate_singular): Fix
pasto, advance __iter only once per iteration.
From-SVN: r118159
* fold-const.c (fold_comparison): Fold ~X op ~Y as Y op X.
Fold ~X op C as X op' ~C, where op' is the swapped comparison.
(fold_binary): ~X eq/ne C is now handled in fold_comparison.
Fold -X eq/ne -Y as X eq/ne Y.
* gcc.dg/fold-compare-1.c: New test case.
From-SVN: r118158
gcc/
* config/mips/mips.md (mul<mode>3): Check ISA_HAS_MUL3 rather than
GENERATE_MULT3_<MODE>. Restrict the test to SImode. Use ISA_HAS_MUL3
rather than GENERATE_MULT3_SI in the various define_peephole2s.
(mulsi3_mult3): Depend on ISA_HAS_MUL3 rather than GENERATE_MULT3_SI.
Use an inclusive test for "mult" rather than "mul".
(rotr<mode>3): Depend on ISA_HAS_ROR.
* config/mips/mips.h (GENERATE_MULT3_SI): Delete in favor of
ISA_HAS_MUL3.
(GENERATE_MULT3_DI): Delete.
(ISA_HAS_64BIT_REGS): Use consistent formatting.
(ISA_HAS_MUL3): New macro.
(ISA_HAS_CONDMOVE, ISA_HAS_8CC): Use consistent formatting.
(ISA_HAS_FP4, ISA_HAS_MADD_MSUB, ISA_HAS_NMADD_NMSUB): Likewise.
(ISA_HAS_CLZ_CLO): Likewise.
(ISA_HAS_DCLZ_DCLO): Delete.
(ISA_HAS_MULHI, ISA_HAS_MULS, ISA_HAS_MSAC): Require !TARGET_MIPS16.
(ISA_HAS_MACC): Require !TARGET_MIPS16 for all ISAs, not just
the VR4120 and VR4130.
(ISA_HAS_MACCHI): Use consistent formatting.
(ISA_HAS_ROTR_SI, ISA_HAS_ROTR_DI): Delete in favor of...
(ISA_HAS_ROR): ...this new macro.
(ISA_HAS_PREFETCH, ISA_HAS_PREFETCHX): Use consistent formatting.
(ISA_HAS_SEB_SEH, ISA_HAS_EXT_INS): Likewise.
(ISA_HAS_LOAD_DELAY): Use ISA_MIPS1.
From-SVN: r118153
PR tree-optimization/15458
* fold-const.c (fold_binary): Optimize ~X ^ C as X ^ ~C, where C
is a constant.
* gcc.dg/fold-xornot-1.c: New test case.
From-SVN: r118152
2006-10-29 Richard Guenther <rguenther@suse.de>
* config/i386/i386-protos.h (ix86_expand_trunc): Declare.
(ix86_expand_truncdf_32): Likewise.
* config/i386/i386.c (ix86_expand_trunc): New function expanding
trunc inline for SSE math and -fno-trapping-math and if not
optimizing for size.
(ix86_expand_truncdf_32): Same for DFmode on 32bit archs.
* config/i386/i386.md (btruncsf2, btruncdf2): Adjust expanders
for expanding btrunc inline for SSE math.
* gcc.target/i386/math-torture/trunc.c: New testcase.
From-SVN: r118148
2006-10-29 Richard Guenther <rguenther@suse.de>
* config/i386/i386-protos.h (ix86_expand_round): Declare.
(ix86_expand_rounddf_32): Likewise.
* config/i386/i386.c (ix86_expand_round): New function expanding
round inline for SSE math and -fno-trapping-math and if not
optimizing for size.
(ix86_expand_rounddf_32): Same for DFmode on 32bit archs.
* config/i386/i386.md (rounddf2, roundsf2): New pattern expanding
round via ix86_expand_round.
* gcc.target/i386/math-torture/round.c: New testcase.
From-SVN: r118146
2006-10-29 Richard Guenther <rguenther@suse.de>
* config/i386/i386-protos.h (ix86_expand_floorceil): Declare.
(ix86_expand_floorceildf_32): Likewise.
* config/i386/i386.c (ix86_expand_sse_compare_mask): New
static helper function.
(ix86_expand_floorceil): Expander for floor and ceil to SSE
math.
(ix86_expand_floorceildf_32): Same for DFmode on 32bit archs.
* config/i386/i386.md (floordf2): Adjust to enable floor
expansion via ix86_expand_floorceil if TARGET_SSE_MATH and
-fno-trapping-math is enabled and if not optimizing for size.
(floorsf2, ceildf2, ceilsf2): Likewise.
* config/i386/sse.md (sse_maskcmpsf3): New insn.
(sse2_maskcmpdf3): Likewise.
* gcc.target/i386/math-torture/ceil.c: New testcase.
* gcc.target/i386/math-torture/floor.c: Likewise.
From-SVN: r118145
2006-10-29 Richard Guenther <rguenther@suse.de>
* builtins.c (expand_builtin_mathfn): Expand nearbyint as
rint in case -fno-trapping-math is enabled.
* config/i386/i386-protos.h (ix86_expand_rint): Declare.
* config/i386/i386.c (ix86_gen_TWO52): New static helper function.
(ix86_expand_sse_fabs): Likewise.
(ix86_expand_rint): New function expanding rint to x87 or SSE math.
* config/i386/i386.md (rintdf2): Enable for SSE math if
-fno-trapping-math is enabled, use ix86_expand_rint for expansion.
(rintsf2): Likewise.
* gcc.target/i386/math-torture/rint.c: New testcase.
* gcc.target/i386/math-torture/nearbyint.c: Likewise.
From-SVN: r118144
gcc/
* configure.ac (HAVE_AS_NO_SHARED): New AC_DEFINE. Test for the
-mno-shared assembler option on mips targets.
* configure, config.in: Regenerate.
* config/mips/linux.h (NO_SHARED_SPECS): New macro.
(DRIVER_SELF_SPECS): Define to NO_SHARED_SPECS if non-empty.
* config/mips/linux64.h (DRIVER_SELF_SPECS): Include NO_SHARED_SPECS.
From-SVN: r118138
gcc/
* config/mips/mips.c (mips_classify_symbol): Test DECL_WEAK as well
as TREE_PUBLIC when deciding whether to return SYMBOL_GOT_GLOBAL.
From-SVN: r118137
2006-10-29 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/29520
* include/tr1/random (geometric_distribution<>::
operator()(_UniformRandomNumberGenerator&)): Only declare.
* include/tr1/random.tcc (geometric_distribution<>::
operator()(_UniformRandomNumberGenerator&),
poisson_distribution<>::operator()(_UniformRandomNumberGenerator&),
binomial_distribution<>::operator()(_UniformRandomNumberGenerator&)):
Reject candidate floating point values not convertible to the
result_type.
From-SVN: r118135
PR fortran/29629
* trans-openmp.c (gfc_trans_omp_array_reduction): Set attr.flavor
of init_val_sym and outer_sym to FL_VARIABLE.
* testsuite/libgomp.fortran/pr29629.f90: New test.
From-SVN: r118134
2006-10-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/29295
* typeck.c (build_unary_op): Use same_type_p when comparing to
boolean type.
2006-10-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/29295
* g++.dg/expr/bool1.C: New test.
* g++.dg/expr/bool2.C: New test.
From-SVN: r118118
2006-10-28 Paolo Carlini <pcarlini@suse.de>
* include/tr1/array (array<>::_M_at): New.
(array<>::at): Fix off-by-one bug, use the above.
* testsuite/tr1/6_containers/array/element_access/
at_out_of_range.cc: Adjust.
* include/tr1/array (class array<>): Remove non-conforming default
for the second parameter.
* include/ext/array_allocator.h: Adjust.
* include/tr1/array (array<>::front, array<>::back): Do not return
a reference to memory not belonging to the array when _Nm == 0.
From-SVN: r118114
2006-10-28 Tobias Burnus <burnus@net-b.de>
PR fortran/29625
* io/transfer.c (formatted_transfer_scalar): Allow binary edit
descriptors for real variables; give error for BOZ edit
descriptor for non-integers when using -std=f*.
From-SVN: r118111
* config/i386/i386.h (GENERAL_REGNO_P): Use STACK_POINTER_REGNUM.
(NON_QI_REG_P): Use IN_RANGE.
(REX_INT_REGNO_P): Use IN_RANGE.
(FP_REGNO_P): Use IN_RANGE.
(SSE_REGNO_P): Use IN_RANGE.
(REX_SSE_REGNO_P): Use IN_RANGE.
(MMX_REGNO_P): Use IN_RANGE.
(STACK_REGNO_P): New macro.
(STACK_REG_P): Use STACK_REGNO_P.
(NON_STACK_REG_P): Use STACK_REGNO_P.
(REGNO_OK_FOR_INDEX_P): Use REX_INT_REGNO_P.
(REGNO_OK_FOR_BASE_P): Use GENERAL_REGNO_P.
(REG_OK_FOR_INDEX_NONSTRICT_P): Use REX_INT_REGNO_P.
(REG_OK_FOR_BASE_NONSTRICT_P): Use GENERAL_REGNO_P.
(HARD_REGNO_RENAME_OK): Use !IN_RANGE.
From-SVN: r118109
* except.h (output_function_exception_table): Add 'const char*' param.
* except.c (switch_to_exception_section): Add 'const char*' param.
If named sections are supported and HAVE_LD_EH_GC_SECTIONS is defined
and flag_function_sections is set, use a function-specific section.
(output_function_exception_table): Add 'const char*' param.
Adjust call to switch_to_exception_section.
* final.c (rest_of_handle_final): Adjust calls to
output_function_exception_table.
* configure.ac (HAVE_LD_EH_GC_SECTIONS): New check.
* config.in: Regenerate.
* configure: Likewise.
From-SVN: r118107
2006-10-28 Richard Guenther <rguenther@suse.de>
PR middle-end/26899
* fold-const.c (maybe_canonicalize_comparison_1): Helper
for maybe_canonicalize_comparison.
(maybe_canonicalize_comparison): New function for canonicalizing
comparison trees.
(fold_comparison): Call it to canonicalize comparisons with
constants involved.
* gcc.dg/tree-ssa/pr26899.c: New testcase.
From-SVN: r118106
PR target/29377
* config/h8300/h8300.c (h8300_emit_stack_adjustment): Change "size"
argument to HOST_WIDE_INT. Update function prototype.
(round_frame_size): Change return type to HOST_WIDE_INT. Change
"size" argument to HOST_WIDE_INT. Update function prototype.
From-SVN: r118102
* include/java-stack.h (ncodeMap): Declare.
(_Jv_StackTrace): Make _Jv_GetMethodDeclaringClass friend.
* java/lang/Class.h (_Jv_GetMethodDeclaringClass): Declare.
* java/lang/natClass.cc (_Jv_GetMethodDeclaringClass): New
function.
* stacktrace.cc (ncodeMap): Redefine from file global to global
for class _Jv_StackTrace.
(_Jv_StackTrace::UpdateNCodeMap): Add interpreted classes, too,
so that _Jv_GetMethodDeclaringClass can find them all.
(_Jv_StackTrace::ClassForFrame): Exclude interpreted classes.
* jvmti.cc (_Jv_JVMTI_GetMethodDeclaringClass): New function.
(_Jv_JVMTI_Interface): Define GetMethodDeclaringClass function.
From-SVN: r118100