gcc.git
9 years agofold-const.c (operand_equal_p): Do not compare TYPE_MODE when comparing addresses.
Jan Hubicka [Fri, 23 Oct 2015 18:05:55 +0000 (20:05 +0200)]
fold-const.c (operand_equal_p): Do not compare TYPE_MODE when comparing addresses.

* fold-const.c (operand_equal_p): Do not compare TYPE_MODE when
comparing addresses.

From-SVN: r229265

9 years agofold-const.c (operand_equal_p): Handle matching of vector constructors.
Jan Hubicka [Fri, 23 Oct 2015 18:05:09 +0000 (20:05 +0200)]
fold-const.c (operand_equal_p): Handle matching of vector constructors.

* fold-const.c (operand_equal_p): Handle matching of vector
constructors.
* gcc.dg/tree-ssa/operand-equal-2.c: New testcase.

From-SVN: r229264

9 years ago* doc/install.texi (*-ibm-aix*): Additional information for AIX 7.1.
David Edelsohn [Fri, 23 Oct 2015 17:25:43 +0000 (17:25 +0000)]
* doc/install.texi (*-ibm-aix*): Additional information for AIX 7.1.

From-SVN: r229263

9 years agoMAINTAINERS: Update email address.
Steve Ellcey [Fri, 23 Oct 2015 17:06:07 +0000 (17:06 +0000)]
MAINTAINERS: Update email address.

2015-10-23  Steve Ellcey  <sellcey@imgtec.com>

* MAINTAINERS: Update email address.

From-SVN: r229262

9 years agoFix ChangeLog entry
Steve Ellcey [Fri, 23 Oct 2015 15:59:15 +0000 (15:59 +0000)]
Fix ChangeLog entry

From-SVN: r229261

9 years agore PR rtl-optimization/67736 (Wrong optimization with -fexpensive-optimizations on...
Steve Ellcey [Fri, 23 Oct 2015 15:58:33 +0000 (15:58 +0000)]
re PR rtl-optimization/67736 (Wrong optimization with -fexpensive-optimizations on mips64el)

2015-10-23  Steve Ellcey  <sellcey@imgtec.com>
    Andrew Pinski  <apinski@cavium.com>

PR rtl-optimization/67736
* gcc.dg/torture/pr67736.c: New test.
* gcc.dg/combine-subregs.c: New test.

Co-Authored-By: Andrew Pinski <apinski@cavium.com>
From-SVN: r229260

9 years agore PR rtl-optimization/67736 (Wrong optimization with -fexpensive-optimizations on...
Steve Ellcey [Fri, 23 Oct 2015 15:56:15 +0000 (15:56 +0000)]
re PR rtl-optimization/67736 (Wrong optimization with -fexpensive-optimizations on mips64el)

2015-10-23  Steve Ellcey  <sellcey@imgtec.com>
    Andrew Pinski  <apinski@cavium.com>

PR rtl-optimization/67736
* combine.c (simplify_comparison): Use gen_lowpart_or_truncate instead
of gen_lowpart.

Co-Authored-By: Andrew Pinski <apinski@cavium.com>
From-SVN: r229259

9 years agore PR middle-end/68066 (ICE in max_value, at wide-int.cc)
Ilya Enkovich [Fri, 23 Oct 2015 13:38:16 +0000 (13:38 +0000)]
re PR middle-end/68066 (ICE in max_value, at wide-int.cc)

gcc/

PR middle-end/68066
* tree.c (build_truth_vector_type): Support BLK mode
returned for boolean vector.

From-SVN: r229256

9 years agognat_rm.texi, [...]: Regenerate.
Arnaud Charlet [Fri, 23 Oct 2015 13:10:35 +0000 (13:10 +0000)]
gnat_rm.texi, [...]: Regenerate.

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* gnat_rm.texi, gnat_ugn.texi: Regenerate.
* doc/share/ada_pygments.py, doc/gnat_ugn/gnat_project_manager.rst,
doc/gnat_ugn/building_executable_programs_with_gnat.rst,
doc/gnat_ugn/gnat_and_program_execution.rst,
doc/gnat_rm/implementation_defined_attributes.rst,
doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
doc/gnat_rm/representation_clauses_and_pragmas.rst,
doc/gnat_rm/implementation_defined_pragmas.rst,
doc/gnat_rm/about_this_guide.rst,
doc/gnat_rm/implementation_of_ada_2012_features.rst,
doc/gnat_rm/implementation_of_specific_ada_features.rst,
doc/gnat_rm/implementation_defined_aspects.rst,
doc/gnat_rm/implementation_advice.rst: Update documentation.

From-SVN: r229254

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 13:04:01 +0000 (15:04 +0200)]
[multiple changes]

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* contracts.ads, contracts.adb: New unit.
* exp_ch6.adb Add with and use clauses for Contracts.
(Expand_Subprogram_Contract): Moved to Contracts.
* exp_ch6.ads (Expand_Subprogram_Contract): Moved to Contracts.
* sem_ch3.adb Add with and use clauses for Contracts.
(Analyze_Object_Contract): Moved to Contracts.
(Analyze_Declarations): Remove local variable Pack_Decl. Do not
capture global references in contracts. Check the hidden states
of a package body.
* sem_ch6.adb Add with and use clauses in Contracts.
(Analyze_Generic_Subprogram_Body): Do not capture global
references in contracts.
(Analyze_Subprogram_Body_Contract):
Moved to Contracts.
(Analyze_Subprogram_Body_Helper): Freeze the
contract of the nearest enclosing package body. Always analyze
the subprogram body contract. Do not expand the subprogram
body contract.
(Analyze_Subprogram_Contract): Moved to Contracts.
* sem_ch6.ads (Analyze_Subprogram_Body_Contract): Moved to Contracts.
(Analyze_Subprogram_Contract): Moved to Contracts.
* sem_ch7.adb Add with and use clauses for Contracts.
(Analyze_Package_Body_Contract): Moved to Contracts.
(Analyze_Package_Body_Helper): Freeze the contract of the
nearest enclosing package body.
(Analyze_Package_Contract): Moved to Contracts.
* sem_ch7.ads (Analyze_Package_Body_Contract): Moved to Contracts.
(Analyze_Package_Contract): Moved to Contracts.
* sem_ch10.adb Add with and use clauses for Contracts.
(Analyze_Compilation_Unit): Do not capture global references
in contracts.
(Analyze_Subprogram_Body_Stub_Contract): Moved to Contracts.
* sem_ch10.ads (Analyze_Subprogram_Body_Stub_Contract): Moved
to Contracts.
* sem_ch12.adb Add with and use clauses for Contracts.
(Analyze_Subprogram_Instantiation): Update the call to
Instantiate_Subprogram_Contract.
(Instantiate_Package_Body):
Do not copy the entity of the spec when creating an entity
for the body. Construct a brand new defining identifier for
the body and inherit the Comes_From_Source flag from the spec.
(Instantiate_Subprogram_Body): Remove Anon_Id to Act_Decl_Id
and update all occurrences. Construct a brand new defining
identifier for the body and inherit the Comes_From_Source
flag from the spec.
(Instantiate_Subprogram_Contract): Moved
to Contracts.
(Save_Global_References_In_Aspects): Moved to
the spec of Sem_Ch12.
(Save_Global_References_In_Contract):
Moved to Contracts.
* sem_ch12.ads (Save_Global_References_In_Aspects): Moved from
the body of Sem_Ch12.
(Save_Global_References_In_Contract):
Moved to Contracts.
* sem_prag.adb Add with and use clauses for Contracts.
(Add_Item): Removed. All references to this routine have been
replaced with calls to Append_New_Elmt.
(Analyze_Constituent):
Add special diagnostics for errors caused by freezing of
contracts.
(Analyze_Refined_State_In_Decl_Part): Add formal
parameter Freeze_Id. Add new global variable Freeze_Posted.
(Collect_Body_States): Removed.
(Report_Unused_States): Removed.
* sem_prag.ads (Analyze_Defined_State_In_Decl_Part): Add formal
parameter Freeze_Id and update comment on usage.
* sem_util.adb Remove with and use clauses for
Sem_Ch12.
(Add_Contract_Item): Moved to Contracts.
(Check_Unused_Body_States): New routine.
(Collect_Body_States):
New routine.
(Create_Generic_Contract): Moved to Contracts.
(Inherit_Subprogram_Contract): Moved to Contracts.
(Report_Unused_Body_States): New routine.
* sem_util.ads (Add_Contract_Item): Moved to Contracts.
(Check_Unused_Body_States): New routine.
(Collect_Body_States): New routine.
(Create_Generic_Contract): Moved to Contracts.
(Inherit_Subprogram_Contract): Moved to Contracts.
(Report_Unused_Body_States): New routine.
* sinfo.adb (Is_Expanded_Contract): New routine.
(Set_Is_Expanded_Contract): New routine.
* sinfo.ads New attribute Is_Expanded_Contract along with
placement in nodes.
(Is_Expanded_Contract): New routine along
with pragma Inline.
(Set_Is_Expanded_Contract): New routine
along with pragma Inline.
* gcc-interface/Make-lang.in: Add entry for contracts.o

2015-10-23  Bob Duff  <duff@adacore.com>

* bindgen.adb, init.c, opt.ads, switch-b.adb: Implement new -Ea and
-Es switches.
* switch-b.ads: Minor comment fix.
* bindusg.adb: Document new -Ea and -Es switches.
* s-exctra.ads: Use -Es instead of -E.

From-SVN: r229253

9 years agoutils2.c (build_call_alloc_dealloc): Check no implicit task and protected object...
Tristan Gingold [Fri, 23 Oct 2015 13:01:23 +0000 (13:01 +0000)]
utils2.c (build_call_alloc_dealloc): Check no implicit task and protected object restrictions.

2015-10-23  Tristan Gingold  <gingold@adacore.com>

* gcc-interface/utils2.c (build_call_alloc_dealloc): Check no implicit
task and protected object restrictions.

From-SVN: r229252

9 years agosem_ch12.adb, [...]: Minor reformatting.
Hristian Kirtchev [Fri, 23 Oct 2015 12:55:06 +0000 (12:55 +0000)]
sem_ch12.adb, [...]: Minor reformatting.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch12.adb, exp_ch6.adb: Minor reformatting.

From-SVN: r229251

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 12:52:53 +0000 (14:52 +0200)]
[multiple changes]

2015-10-23  Gary Dismukes  <dismukes@adacore.com>

* exp_ch6.adb: Minor reformatting.

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* sem_ch12.adb (Check_Formal_Packages): A formal package whose
actual part is (others => <>) os identical to a formal package
with an actual part written as (<>).

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* a-reatim.adb ("/"): For Time_Span division convert the operands
to integers and then use integer division, which conforms to
the rounding required by Ada RM.

From-SVN: r229250

9 years agosem_ch6.adb (Check_Missing_Return): Do not report a missing return statement on a...
Ed Schonberg [Fri, 23 Oct 2015 12:51:30 +0000 (12:51 +0000)]
sem_ch6.adb (Check_Missing_Return): Do not report a missing return statement on a function body constructed to...

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* sem_ch6.adb (Check_Missing_Return): Do not report a missing
return statement on a function body constructed to complete a
package body for a premature instantiation.

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* exp_ch6.adb (Build_Procedure_Body_Form): Replace body of
original function with that of generated procedure, to simplify
processing and avoid scoping problems with local declarations.
(Rewrite_Function_Call_For_C): Handle properly the case of a
parameterless function.

From-SVN: r229249

9 years agoa-exextr.adb, [...]: Minor reformatting.
Hristian Kirtchev [Fri, 23 Oct 2015 12:50:16 +0000 (12:50 +0000)]
a-exextr.adb, [...]: Minor reformatting.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* a-exextr.adb, sem_ch6.adb, sem_ch13.adb: Minor reformatting.

From-SVN: r229248

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 12:48:46 +0000 (14:48 +0200)]
[multiple changes]

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* s-taskin.ads: Minor code clean up.
(Ada_Task_Control_Block): Move fixed size field before variable sized
ones.
* einfo.ads: Minor editing.

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* sem_ch6.adb (Check_Aggregate_Accessibility): Apply rule in RM
6.5 (8.3) to verify that access discriminants in an aggregate
in a return statement have the proper accessibility, i.e. do
not lead to dangling references.

2015-10-23  Eric Botcazou  <ebotcazou@adacore.com>

* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Add missing
test on Address_Clause_Overlay_Warnings to the "constant overlays
variable" warning. For the reverse case, also issue a warning if
the modification is potentially made through the initialization
of the variable.

2015-10-23  Jose Ruiz  <ruiz@adacore.com>

* a-exetim-posix.adb (Clock): Use the pthread_getcpuclockid
function to have access to CPU clocks for tasks other than the
calling task.

From-SVN: r229247

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 12:40:50 +0000 (14:40 +0200)]
[multiple changes]

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* debug.adb: Switch -gnatd.5 is no longer in use, remove the
associated documentation.
* exp_dbug.adb (Get_External_Name): Do not add a special prefix
for ignored Ghost entities or when switch -gnatd.5 is enabled.
* exp_dbug.ads Remove the documentation concerning the encoding
of ignored Ghost entities.

2015-10-23  Bob Duff  <duff@adacore.com>

* a-exextr.adb (Notify_Exception): For Unhandled_Raise_In_Main,
mimic the output from Ada.Exceptions.Last_Chance_Handler; don't
print "Exception raised".
* s-stalib.ads, s-exctra.ads, s-exctra.adb: Add
Unhandled_Raise_In_Main to types Exception_Trace_Kind/Trace_Kind.

From-SVN: r229246

9 years agoSupport for vectorizing conditional expressions
Alan Hayward [Fri, 23 Oct 2015 12:40:33 +0000 (12:40 +0000)]
Support for vectorizing conditional expressions

2015-10-23  Alan Hayward <alan.hayward@arm.com>

gcc/
PR tree-optimization/65947
* tree-vect-loop.c
(vect_is_simple_reduction_1): Find condition reductions.
(vect_model_reduction_cost): Add condition reduction costs.
(get_initial_def_for_reduction): Add condition reduction initial var.
(vect_create_epilog_for_reduction): Add condition reduction epilog.
(vectorizable_reduction): Condition reduction support.
* tree-vect-stmts.c (vectorizable_condition): Add vect reduction arg
* doc/sourcebuild.texi (Vector-specific attributes): Document
vect_max_reduc

gcc/testsuite
PR tree-optimization/65947
* lib/target-supports.exp
(check_effective_target_vect_max_reduc): Add.
* gcc.dg/vect/pr65947-1.c: New test.
* gcc.dg/vect/pr65947-2.c: New test.
* gcc.dg/vect/pr65947-3.c: New test.
* gcc.dg/vect/pr65947-4.c: New test.
* gcc.dg/vect/pr65947-5.c: New test.
* gcc.dg/vect/pr65947-6.c: New test.
* gcc.dg/vect/pr65947-7.c: New test.
* gcc.dg/vect/pr65947-8.c: New test.
* gcc.dg/vect/pr65947-9.c: New test.
* gcc.dg/vect/pr65947-10.c: New test.
* gcc.dg/vect/pr65947-11.c: New test.

From-SVN: r229245

9 years agoexp_attr.adb, [...]: Minor reformatting.
Hristian Kirtchev [Fri, 23 Oct 2015 12:39:08 +0000 (12:39 +0000)]
exp_attr.adb, [...]: Minor reformatting.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* exp_attr.adb, freeze.adb, sem_attr.adb, exp_aggr.adb,
gnatname.adb: Minor reformatting.

From-SVN: r229244

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 12:37:35 +0000 (14:37 +0200)]
[multiple changes]

2015-10-23  Steve Baird  <baird@adacore.com>

* a-cbdlli.ads, a-cbhama.ads, a-cbhase.ads, a-cbmutr.ads,
a-cborma.ads, a-cborse.ads, a-cbprqu.ads, a-cbsyqu.ads,
a-cdlili.ads, a-cfdlli.ads, a-cfhama.ads, a-cfhase.ads,
a-cfinve.ads, a-cforma.ads, a-cforse.ads, a-cidlli.ads,
a-cihama.ads, a-cihase.ads, a-cimutr.ads, a-ciorma.ads,
a-ciormu.ads, a-ciorse.ads, a-coboho.ads, a-cobove.ads,
a-cofove.ads, a-cohama.ads, a-cohase.ads, a-coinho.ads,
a-coinho-shared.ads, a-coinve.ads, a-comutr.ads, a-conhel.ads,
a-convec.ads, a-coorma.ads, a-coormu.ads, a-coorse.ads,
a-cuprqu.ads, a-cusyqu.ads, a-rbtgbo.ads: Add spec Annotate
pragmas.
* a-cbdlli.adb, a-cbhama.adb, a-cbhase.adb, a-cbmutr.adb,
a-cborma.adb, a-cborse.adb, a-cbprqu.adb, a-cbsyqu.adb,
a-cdlili.adb, a-cfdlli.adb, a-cfhama.adb, a-cfhase.adb,
a-cfinve.adb, a-cforma.adb, a-cforse.adb, a-cidlli.adb,
a-cihama.adb, a-cihase.adb, a-cimutr.adb, a-ciorma.adb,
a-ciormu.adb, a-ciorse.adb, a-coboho.adb, a-cobove.adb,
a-cofove.adb, a-cohama.adb, a-cohase.adb, a-coinho.adb,
a-coinho-shared.adb, a-coinve.adb, a-comutr.adb, a-conhel.adb,
a-convec.adb, a-coorma.adb, a-coormu.adb, a-coorse.adb,
a-cuprqu.adb, a-cusyqu.adb, a-rbtgbo.adb: Remove body Annotate
pragmas.

2015-10-23  Vincent Celier  <celier@adacore.com>

* gnatname.adb: When gnatname is invoked with a project file,
specified with switch -P, if gprname is available, gnatname will
invoke gprname, with the target if it is a cross gnatname.

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* exp_ch4.adb: Fix typo.
* exp_ch6.adb: Update comment.
* exp_attr.adb (Expand_Min_Max_Attribute): Simplify expansion.
* exp_aggr.adb (Convert_To_Positional): Only convert to
positional when generating C in case of an object declaration.
(In_Object_Declaration): New.
(Late_Expansion): Adapt to trees generated by Modify_Tree_For_C.
* sinfo.ads: Update documentation.

2015-10-23  Joel Brobecker  <brobecker@adacore.com brobecker>

* sigtramp.h (struct sigcontext, struct ucontext): Remove declarations,
and replace them by include of corresponding header file.

From-SVN: r229243

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 12:29:51 +0000 (14:29 +0200)]
[multiple changes]

2015-10-23  Bob Duff  <duff@adacore.com>

* a-convec.adb (Copy): Make sure C is initialized
on all paths, including when Checks is False.

2015-10-23  Eric Botcazou  <ebotcazou@adacore.com>

* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove
error as unreachable.

From-SVN: r229242

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 12:28:53 +0000 (14:28 +0200)]
[multiple changes]

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* gnat1drv.adb (Adjust_Global_Switches): Adjust.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* exp_dbug.ads, exp_dbug.adb (Get_External_Name): The special prefix for
ignored Ghost entities is now ___ghost_.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* ghost.adb (Is_Subject_To_Ghost): Check the
original node when searching for pragma Ghost to catch cases
where a source construct has been rewritten into something else.

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* einfo.ads, einfo.adb (Rewritten_For_C): New flag on functions
that return a constrained array type.  When generating C these
functions are rewritten as procedures with an out parameter,
and calls to such functions are rewritten accordingly.
* exp_ch6.adb (Expand_N_Subprogram_Declaration): When
Modify_Tree_For_C is set and the function returns a constrained
array type, generate a procedure declaration with an additional
out parameter. Mark original function as Rewritten_For_C.
The new declaration is inserted in tree immediately after
current declaration.
(Expand_Subprogram_Body): If entity is marked Rewritten_For_C,
generate body of corresponding procedure using declarations
and statements for function body. Replace return statements
with assignments to the out parameter, followed by a simple
return statement.
(Rewrite_Function_Call_For_C): New procedure to replace a function
call that returns an array by a procedure call.

From-SVN: r229241

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 12:24:22 +0000 (14:24 +0200)]
[multiple changes]

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_util.adb (Denotes_Iterator): New routine.
(Is_Iterator): Code cleanup. Factor out the detection of a
predefined iterator.  As a result this fixes a missing case
where a tagged type implements interface Reversible_Iterator.

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* sem_attr.adb (Eval_Attribute): Constant-fold 'Enabled if
not within a generic unit, even if expander is not active, so
that instances of container packages remain preelaborable in
-gnatc mode.

2015-10-23  Tristan Gingold  <gingold@adacore.com>

* init.c (__gnat_sigtramp): New assembly function for arm64-darwin.
(__gnat_error_handler): Use trampoline for arm64.

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* exp_ch3.adb (Expand_N_Object_Declaration): if the type of the
object is a class-wide limited interface type, the expression
is not restricted to the forms specified for limited types.

2015-10-23  Vincent Celier  <celier@adacore.com>

* gnatname.adb: Code clean up.
* s-taasde.ads: Fix comment.

From-SVN: r229240

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 12:21:21 +0000 (14:21 +0200)]
[multiple changes]

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* sem_util.adb (Is_Iterator, Is_Reversible_iterator): Use
root type to determine whether the type is a descendant of the
corresponding interface type, so take into account multiple
levels of subtypes and derivations.

2015-10-23  Olivier Hainque  <hainque@adacore.com>

* tracebak.c: Refine selection of GCC/GENERIC_UNWINDER for
tracebacks on x86 & x86_64.
(x86 & x86_64): If !SJLJ, always pick the
GCC_UNWINDER for x86_64 (not only on linux).
* sem_util.ads: Minor fix in comment.

From-SVN: r229239

9 years agosem_prag.adb (Analyze_Pragma): Pragma Volatile_Function should not apply to a functio...
Hristian Kirtchev [Fri, 23 Oct 2015 12:19:35 +0000 (12:19 +0000)]
sem_prag.adb (Analyze_Pragma): Pragma Volatile_Function should not apply to a function instantiation.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_prag.adb (Analyze_Pragma): Pragma Volatile_Function should
not apply to a function instantiation.
* sem_util.adb (Has_Effectively_Volatile_Profile): New routine.
(Is_Volatile_Function): An instance of Ada.Unchecked_Conversion
is a volatile function when its profile contains an effectively
volatile type.
* sem_util.ads (Has_Effectively_Volatile_Profile): New routine.

From-SVN: r229238

9 years agore PR libgcc/66883 (config/epiphany/udivsi3-float.c:52: bad if test ?)
Joern Rennecke [Fri, 23 Oct 2015 11:57:26 +0000 (11:57 +0000)]
re PR libgcc/66883 (config/epiphany/udivsi3-float.c:52: bad if test ?)

        PR libgcc/66883
        * config/epiphany/udivsi3-float.c: Fix CONCISE test, and comment typo.

N.B., this is not active code, just documenting a previous approach for this
function in C.

From-SVN: r229236

9 years agoMakefile.in (build/genmatch.o): Properly depend on is-a.h, tree.def and builtins...
Richard Biener [Fri, 23 Oct 2015 11:08:10 +0000 (11:08 +0000)]
Makefile.in (build/genmatch.o): Properly depend on is-a.h, tree.def and builtins.def.

2015-10-23  Richard Biener  <rguenther@suse.de>

* Makefile.in (build/genmatch.o): Properly depend on is-a.h, tree.def
and builtins.def.

From-SVN: r229235

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 10:55:10 +0000 (12:55 +0200)]
[multiple changes]

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* exp_unst.adb (Unnest_Subprogram): Complete previous
change and update comments.

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* sem_util.ads, sem_util.adb (Check_Function_With_Address_Parameter):
A subprogram that has an Address parameter and is declared in a Pure
package is not considered Pure, because the parameter may be used as a
pointer and the referenced data may change even if the address value
itself does not.
* freeze.adb (Freeze_Subprogram): use it.
* exp_ch6.adb (Expand_N_Subprogram_Body): Use it.

From-SVN: r229234

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 10:52:34 +0000 (12:52 +0200)]
[multiple changes]

2015-10-23  Olivier Hainque  <hainque@adacore.com>

* tracebak.c: Fallback to generic unwinder for gcc-sjlj on x86 &
x86_64 linux
* tracebak.c: Rework x86 & x86_64 sections to resort to the
generic unwinder if __USING_SJLJ_EXCEPTIONS__.

2015-10-23  Javier Miranda  <miranda@adacore.com>

* sem_util.adb (Check_Function_Writable_Actuals): For function
calls restrict the check to elementary types, as requested by
RM 6.4.1(6.15/3)

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* exp_unst.adb (Unnest_Subprogram): Suppress initialization on
Decl_ARECnT since we are taking care of all initializations in
the generated code.

From-SVN: r229233

9 years agoAdjust previous change.
Arnaud Charlet [Fri, 23 Oct 2015 10:51:06 +0000 (12:51 +0200)]
Adjust previous change.

From-SVN: r229232

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 10:49:44 +0000 (12:49 +0200)]
[multiple changes]

2015-10-23  Ed Schonberg  <schonberg@adacore.com>

* sem_dim.adb (Analyze_Dimension_Extension_Or_Record_Aggregate):
Handle properly a box-initialized aggregate component.

2015-10-23  Yannick Moy  <moy@adacore.com>

* sem_prag.adb (Analyze_Pragma): Reject Volatile_Function not placed
on a function.

2015-10-23  Yannick Moy  <moy@adacore.com>

* a-extiin.ads, a-reatim.ads, a-interr.ads, a-exetim-mingw.ads,
a-exetim-default.ads, a-exetim.ads, a-taside.ads: Add "Global => null"
contract on subprograms.
* lib-xref-spark_specific.adb: collect scopes for stubs of
protected objects

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* gnat1drv.adb (Adjust_Global_Switches): Enable
Back_Annotate_Rep_Info to get size information from gigi.
(Gnat1drv): Code clean ups.
* frontend.adb (Frontend): Ditto.

From-SVN: r229231

9 years agognat1drv.adb (Adjust_Global_Switches): Adjust settings.
Arnaud Charlet [Fri, 23 Oct 2015 10:46:27 +0000 (10:46 +0000)]
gnat1drv.adb (Adjust_Global_Switches): Adjust settings.

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* gnat1drv.adb (Adjust_Global_Switches): Adjust settings.
* sem.adb (Semantics): Remove special case.

From-SVN: r229230

9 years agoAdd missing private clause in libgomp.c++/member-2.C
Tom de Vries [Fri, 23 Oct 2015 10:45:13 +0000 (10:45 +0000)]
Add missing private clause in libgomp.c++/member-2.C

2015-10-23  Tom de Vries  <tom@codesourcery.com>

PR testsuite/68063
* testsuite/libgomp.c++/member-2.C (A::m1): Add missing private clause.

From-SVN: r229229

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 10:44:35 +0000 (12:44 +0200)]
[multiple changes]

2015-10-23  Gary Dismukes  <dismukes@adacore.com>

* bindgen.adb, restrict.adb: Minor spelling/grammar fixes.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_res.adb (Resolve_Entity_Name): Code cleanup. Check for possible
elaboration issues in SPARK when the name denotes a source variable.

From-SVN: r229228

9 years agoexp_ch7.adb (Process_Transient_Objects): Reimplement to properly handle restriction...
Hristian Kirtchev [Fri, 23 Oct 2015 10:43:30 +0000 (10:43 +0000)]
exp_ch7.adb (Process_Transient_Objects): Reimplement to properly handle restriction No_Exception_Propagation.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* exp_ch7.adb (Process_Transient_Objects): Reimplement to properly
handle restriction No_Exception_Propagation.
* exp_ch11.adb (Expand_At_End_Handler): Update the parameter
profile and all references to Block.
* exp_ch11.ads (Expand_At_End_Handler): Update the parameter
profile and comment on usage.
* exp_intr.adb (Expand_Unc_Deallocation): Reimplement to properly
handle restriction No_Exception_Propagation.
* gnat1drv.adb, restrict.adb: Update comment.

From-SVN: r229227

9 years agoexp_ch6.adb (Expand_N_Extended_Return_Statement): Do not call SS_Release for a block...
Bob Duff [Fri, 23 Oct 2015 10:41:13 +0000 (10:41 +0000)]
exp_ch6.adb (Expand_N_Extended_Return_Statement): Do not call SS_Release for a block statement enclosing the return statement in...

2015-10-23  Bob Duff  <duff@adacore.com>

* exp_ch6.adb (Expand_N_Extended_Return_Statement): Do not call
SS_Release for a block statement enclosing the return statement in the
case where a build-in-place function return is returning
the result on the secondary stack. This is accomplished by
setting the Sec_Stack_Needed_For_Return flag on such blocks.
It was already being set for the function itself, and it was
already set correctly for blocks in the non-build-in-place case
(in Expand_Simple_Function_Return).
(Set_Enclosing_Sec_Stack_Return): New procedure to perform
the Set_Sec_Stack_Needed_For_Return calls. Called in the
build-in-place and non-build-in-place cases.
(Expand_Simple_Function_Return): Call
Set_Enclosing_Sec_Stack_Return instead of performing the loop
in line.

2015-10-23  Bob Duff  <duff@adacore.com>

* scng.adb (Char_Literal_Case): If an apostrophe
follows a reserved word, treat it as a lone apostrophe, rather
than the start of a character literal. This was already done for
"all", but it needs to be done also for (e.g.) "Delta".

From-SVN: r229226

9 years agofold-const.c (fold_binary_loc): Move Fold (A & ~B) - (A & B) into (A ^ B) - B to...
Richard Biener [Fri, 23 Oct 2015 10:30:49 +0000 (10:30 +0000)]
fold-const.c (fold_binary_loc): Move Fold (A & ~B) - (A & B) into (A ^ B) - B to match.pd Move (X & ~Y) | (~X &...

2015-10-23  Richard Biener  <rguenther@suse.de>
    Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

* fold-const.c (fold_binary_loc) : Move Fold (A & ~B) - (A & B)
into (A ^ B) - B to match.pd
Move (X & ~Y) | (~X & Y) is X ^ Y to match.pd.

* match.pd (minus (bit_and:cs @0 (bit_not @1)) (bit_and:s @0 @1)):
New simplifier.
(minus (bit_and:s @0 INTEGER_CST@2) (bit_and:s @0 INTEGER_CST@1)):
New simplifier.
(minus (bit_and:s @0 @1) (bit_and:cs @0 (bit_not @1))):
New simplifier.
(bit_ior:c (bit_and:c @0 (bit_not @1)) (bit_and:c (bit_not @0) @1)):
New simplifier.
(bit_ior:c (bit_and @0 INTEGER_CST@2) (bit_and (bit_not @0)
INTEGER_CST@1)): New simplifier.

Co-Authored-By: Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
From-SVN: r229225

9 years ago[multiple changes]
Arnaud Charlet [Fri, 23 Oct 2015 10:29:50 +0000 (12:29 +0200)]
[multiple changes]

2015-10-23  Bob Duff  <duff@adacore.com>

* exp_strm.adb (Build_Record_Or_Elementary_Input_Function): Use
Underlying_Type for B_Typ, in case the Typ is a subtype of a type with
unknown discriminants.
* g-awk.ads: Minor style fix in comment

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* debug.adb: Document the use of debug switch -gnatd.5.
* einfo.adb: Code reformatting. (Is_Ghost_Entity): Moved from ghost.adb.
* einfo.ads New synthesized attribute Is_Ghost_Enity along
with usage in nodes and pragma Inline.
(Is_Ghost_Entity: Moved from ghost.ads.
* exp_ch3.adb Code reformatting.
(Expand_Freeze_Array_Type): Capture, set and restore the Ghost mode.
(Expand_Freeze_Class_Wide_Type): Capture, set and restore the
Ghost mode.
(Expand_Freeze_Enumeration_Type): Capture, set and
restore the Ghost mode.
(Expand_Freeze_Record_Type): Capture, set and restore the Ghost mode.
* exp_ch6.adb (Expand_Subprogram_Contract): Do not expand the
contract of an ignored Ghost subprogram.
* exp_ch13.adb Add with and use clauses for Ghost.
(Expand_N_Freeze_Entity): Capture, set and restore the Ghost mode.
* exp_dbug.adb (Get_External_Name): Code reformatting. Add a
special prefix for ignored Ghost entities or when requested by
-gnatd.5 for any Ghost entity.
* exp_dbug.ads Document the use of prefix "_ghost_" for ignored
Ghost entities.
* exp_prag.adb (Expand_Pragma_Check): Capture, set and restore the
Ghost mode.
(Expand_Pragma_Loop_Variant): Use In_Assertion_Expr
to signal the original context.
* ghost.adb (Check_Ghost_Overriding): Code cleanup.
(Is_Ghost_Entity): Moved to einfo.adb. (Is_OK_Declaration):
Move the assertion expression check to the outer level.
(Is_OK_Ghost_Context): An assertion expression is a valid Ghost
context.
* ghost.ads (Is_Ghost_Entity): Moved to einfo.ads.
* sem_ch3.adb (Analyze_Object_Contract): A source Ghost object
cannot be imported or exported. Mark internally generated objects
as Ghost when applicable.
(Make_Class_Wide_Type): Inherit the ghostness of the root tagged type.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Mark
a stand alone subprogram body as Ghost when applicable.
(Analyze_Subprogram_Declaration): Mark internally generated
subprograms as Ghost when applicable.
* sem_ch7.adb: Code cleanup.
* sem_ch13.adb (Add_Invariants): Add various formal
parameters to break dependency on global variables.
(Build_Invariant_Procedure): Code cleanup. Capture, set and
restore the Ghost mode.
* sem_res.adb (Resolve_Actuals): The actual parameter of a source
Ghost subprogram whose formal is of mode IN OUT or OUT must be
a Ghost variable.

2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch8.adb Code cleanup.
(Find_Expanded_Name): Replace
the call to In_Pragmas_Depends_Or_Global with a call to
In_Abstract_View_Pragma.
(In_Abstract_View_Pragma): New routine.
(In_Pragmas_Depends_Or_Global): Removed.
* sem_prag.adb (Analyze_Part_Of): Catch a case where indicator
Part_Of denotes the abstract view of a variable.

From-SVN: r229224

9 years agosem_util.ads (Unique_Defining_Entity): Document the result for tasks and entries.
Arnaud Charlet [Fri, 23 Oct 2015 10:25:57 +0000 (10:25 +0000)]
sem_util.ads (Unique_Defining_Entity): Document the result for tasks and entries.

2015-10-23  Arnaud Charlet  <charlet@adacore.com>

* sem_util.ads (Unique_Defining_Entity): Document the result
for tasks and entries.
* sem_util.adb (Unique_Entity): Return declaration entity for task and
entry bodies

From-SVN: r229222

9 years agoMove fold_trunc_transparent_mathfn to match.pd
Richard Sandiford [Fri, 23 Oct 2015 10:01:47 +0000 (10:01 +0000)]
Move fold_trunc_transparent_mathfn to match.pd

This moves the fold rules for trunc, floor, ceil, round, nearbyint and
rint in one go, since they're tested as a group.  Most of the code is
supporting the f(x)->x fold when x is known to be integer-valued.
Like with the non-negative test, this is probably more elegantly handled
by tracking range information for reals, but until that happens, I think
we should handle it analogously to tree_expr_nonnegative_p.

I've incorporated the fix for PR68031 in the new version of
integer_valued_real_p.  However, it seemed confusing to test for an
SSA name at the head of the function rather than the case statement,
and not fall through to tree_simple_nonnegative_warnv_p (which
conceptually shouldn't care whether an update is in progress).
But tree_simple_nonnegative_warnv_p is a no-op for SSA names,
so I simply changed it to:

          return (!name_registered_for_update_p (t)
      && depth < PARAM_VALUE (PARAM_MAX_SSA_NAME_QUERY_DEPTH)
      && gimple_stmt_nonnegative_warnv_p (SSA_NAME_DEF_STMT (t),
  strict_overflow_p, depth));

and used that in the new code too.

Doing these folds later meant that IPA would start to use information
about the aborting sinf and floor in 20030125-1.c before the folds
kicked in.  I changed them from noinline to weak to stop that.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (integer_valued_real_p): Move to fold-const.c.
(fold_trunc_transparent_mathfn, fold_builtin_trunc, fold_builtin_floor)
(fold_builtin_ceil, fold_builtin_round): Delete.
(fold_builtin_1): Handle constant trunc, floor, ceil and round
arguments here.
* convert.c (convert_to_real): Remove narrowing of rounding
functions.
* fold-const.h (integer_valued_real_unary_p)
(integer_valued_real_binary_p, integer_valued_real_call_p)
(integer_valued_real_single_p, integer_valued_real_p): Declare.
* fold-const.c (tree_single_nonnegative_warnv_p): Move
name_registered_for_update_p check to SSA_NAME case statement.
Don't call tree_simple_nonnegative_warnv_p for SSA names.
(integer_valued_real_unary_p, integer_valued_real_binary_p)
(integer_valued_real_call_p, integer_valued_real_single_p)
(integer_valued_real_invalid_p): New functions.
(integer_valued_real_p): Move from fold-const.c and rework
to call the functions above.  Handle SSA names.
* gimple-fold.h (gimple_stmt_integer_valued_real_p): Declare.
* gimple-fold.c (gimple_assign_integer_valued_real_p)
(gimple_call_integer_valued_real_p, gimple_phi_integer_valued_real_p)
(gimple_stmt_integer_valued_real_p): New functions.
* match.pd: Fold f(f(x))->f(x) for fp->fp rounding functions f.
Fold f(x)->x for the same f if x is known to be integer-valued.
Fold f(extend(x))->extend(f'(x)) if doing so doesn't affect
the result.  Canonicalize floor(x) as trunc(x) if x is
nonnegative.

gcc/testsuite/
* gcc.c-torture/execute/20030125-1.c (floor, floorf, sin, sinf):
Make weak rather than noinline.
* gcc.dg/builtins-57.c: Compile with -O.
* gcc.dg/torture/builtin-integral-1.c: Skip for -O0.

From-SVN: r229221

9 years agoMAINTAINERS: Update email address.
Paulo Matos [Fri, 23 Oct 2015 09:51:32 +0000 (09:51 +0000)]
MAINTAINERS: Update email address.

2015-10-23  Paulo Matos  <pmatos@linki.tools>

        * MAINTAINERS: Update email address.

From-SVN: r229220

9 years agoUse make_constraint_from in intra_create_variable_infos
Tom de Vries [Fri, 23 Oct 2015 09:38:45 +0000 (09:38 +0000)]
Use make_constraint_from in intra_create_variable_infos

2015-10-23  Tom de Vries  <tom@codesourcery.com>

* tree-ssa-structalias.c (intra_create_variable_infos): Use
make_constraint_from.

From-SVN: r229219

9 years agoAdd missing is_full_var setting in create_variable_info_for_1
Tom de Vries [Fri, 23 Oct 2015 09:38:36 +0000 (09:38 +0000)]
Add missing is_full_var setting in create_variable_info_for_1

2015-10-23  Tom de Vries  <tom@codesourcery.com>

* tree-ssa-structalias.c (create_variable_info_for_1): Add missing
setting of is_full_var in case of a single field.

From-SVN: r229218

9 years agoRun tree-ssa/restrict-4.c without fipa-icf
Tom de Vries [Fri, 23 Oct 2015 09:38:26 +0000 (09:38 +0000)]
Run tree-ssa/restrict-4.c without fipa-icf

2015-10-23  Tom de Vries  <tom@codesourcery.com>

* gcc.dg/tree-ssa/restrict-4.c: Add -fno-ipa-icf to dg-options.

From-SVN: r229217

9 years agoMAINTAINERS (Write After Approval): Add myself.
Alan Hayward [Fri, 23 Oct 2015 09:05:49 +0000 (09:05 +0000)]
MAINTAINERS (Write After Approval): Add myself.

2015-10-23  Alan Hayward <alan.hayward@arm.com>

* MAINTAINERS  (Write After Approval): Add myself.

From-SVN: r229216

9 years agoUpdate HOWTO_MERGE file for libsanitizer.
Maxim Ostapenko [Fri, 23 Oct 2015 08:50:30 +0000 (11:50 +0300)]
Update HOWTO_MERGE file for libsanitizer.

From-SVN: r229215

9 years agoFix typo.
Nick Clifton [Fri, 23 Oct 2015 07:39:32 +0000 (07:39 +0000)]
Fix typo.

From-SVN: r229213

9 years agoFix ASan output pattern tests on Darwin.
Max Ostapenko [Fri, 23 Oct 2015 07:22:37 +0000 (10:22 +0300)]
Fix ASan output pattern tests on Darwin.

gcc/testsuite/

PR sanitizer/68042
* c-c++-common/asan/memcmp-1.c: Adjust test to pass on Darwin.
* c-c++-common/asan/sanity-check-pure-c-1.c: Likewise.

From-SVN: r229212

9 years agotypo
Jason Merrill [Fri, 23 Oct 2015 00:52:46 +0000 (20:52 -0400)]
typo

From-SVN: r229211

9 years agocall.c (add_template_conv_candidate): Pass DEDUCE_CALL.
Jason Merrill [Fri, 23 Oct 2015 00:51:14 +0000 (20:51 -0400)]
call.c (add_template_conv_candidate): Pass DEDUCE_CALL.

* call.c (add_template_conv_candidate): Pass DEDUCE_CALL.
(add_template_candidate_real): Handle it.
(fn_type_unification): Handle it.

From-SVN: r229210

9 years agocall.c (add_conv_candidate): Remove first_arg parm.
Jason Merrill [Fri, 23 Oct 2015 00:51:07 +0000 (20:51 -0400)]
call.c (add_conv_candidate): Remove first_arg parm.

* call.c (add_conv_candidate): Remove first_arg parm.
(add_template_conv_candidate): Likewise.
(add_template_candidate_real): Don't pass it.
(build_op_call_1): Likewise.

From-SVN: r229209

9 years agoDaily bump.
GCC Administrator [Fri, 23 Oct 2015 00:16:14 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r229208

9 years agore PR driver/68043 (many undocumented options, missing punctuation)
Martin Sebor [Thu, 22 Oct 2015 23:48:17 +0000 (23:48 +0000)]
re PR driver/68043 (many undocumented options, missing punctuation)

gcc/ChangeLog:

2015-10-22  Martin Sebor  <msebor@redhat.com>

PR driver/68043
* config/i386/i386.opt: Add missing periods to the ends of sentences.
* config/msp430/msp430.opt: Same.

gcc/testsuite/ChangeLog:

2015-10-22  Martin Sebor  <msebor@redhat.com>

PR driver/68043
* gcc.misc-tests/help.exp: Verify that option descriptions
end in periods.
* lib/options.exp (check_for_options): Use the regexp --line option.
Print unexpected match on failure.

From-SVN: r229205

9 years agopr67985-3.c (dg-options): Add -mfpmath=sse.
Uros Bizjak [Thu, 22 Oct 2015 21:37:06 +0000 (23:37 +0200)]
pr67985-3.c (dg-options): Add -mfpmath=sse.

* gcc.target/i386/pr67985-3.c (dg-options): Add -mfpmath=sse.

From-SVN: r229199

9 years agoFix up ChangeLog for rev. 229155.
Martin Sebor [Thu, 22 Oct 2015 20:57:00 +0000 (14:57 -0600)]
Fix up ChangeLog for rev. 229155.

From-SVN: r229195

9 years agoProposed doc update for Explicit Reg Vars 3/3
David Wohlferd [Thu, 22 Oct 2015 20:11:29 +0000 (20:11 +0000)]
Proposed doc update for Explicit Reg Vars 3/3

* doc/extend.exp (Global Register Variables): Rewrite.

From-SVN: r229188

9 years ago[PATCH 3/9] ENABLE_CHECKING refactoring: Java and Ada
Mikhail Maltsev [Thu, 22 Oct 2015 19:21:39 +0000 (19:21 +0000)]
[PATCH 3/9] ENABLE_CHECKING refactoring: Java and Ada

[PATCH 3/9] ENABLE_CHECKING refactoring: Java and Ada
gcc/java/ChangeLog:

2015-10-05  Mikhail Maltsev  <maltsevm@gmail.com>

* decl.c (java_mark_decl_local): Use flag_checking instead of
ENABLE_CHECKING.

gcc/ada/ChangeLog:

2015-10-05  Mikhail Maltsev  <maltsevm@gmail.com>

* gcc-interface/decl.c (gnat_to_gnu_entity): Use gcc_checking_assert.
* gcc-interface/trans.c (assoc_to_constructor): Use flag_checking.
* gcc-interface/utils.c (relate_alias_sets): Likewise.
* gcc-interface/utils2.c (build_binary_op, build_unary_op): Use
gcc_checking_assert

From-SVN: r229185

9 years ago[PATCH] Fix abort in write_eligible_delay
Jeff Law [Thu, 22 Oct 2015 19:18:05 +0000 (13:18 -0600)]
[PATCH] Fix abort in write_eligible_delay

[PATCH] Fix abort in write_eligible_delay
        * genattrtab.c (main): If we do not have any annul-true or annul-false
        slots, then write out a dummy eligible_for_annul_true or
        eligible_for_annul_false as needed.

From-SVN: r229184

9 years agomsp430.opt: Add -msilicon-errata and -msilicon-errata-warn.
Nick Clifton [Thu, 22 Oct 2015 16:00:38 +0000 (16:00 +0000)]
msp430.opt: Add -msilicon-errata and -msilicon-errata-warn.

* config/msp430/msp430.opt: Add -msilicon-errata and
-msilicon-errata-warn.
* config/msp430/msp430.h (ASM_SPEC): Pass new options on to
assembler.
* doc/invoke.texi: Document new options.

From-SVN: r229177

9 years agore PR c++/67838 (Rejects-valid-code: templated lambda variable.)
Paolo Carlini [Thu, 22 Oct 2015 14:55:14 +0000 (14:55 +0000)]
re PR c++/67838 (Rejects-valid-code: templated lambda variable.)

2015-10-22  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/67838
* g++.dg/cpp1y/var-templ46.C: New.

From-SVN: r229175

9 years agooops- omitted by accident from the previous delta.
Nick Clifton [Thu, 22 Oct 2015 14:45:44 +0000 (14:45 +0000)]
oops-  omitted by accident from the previous delta.

From-SVN: r229174

9 years agore PR tree-optimization/58497 (SLP vectorizes identical operations)
Richard Biener [Thu, 22 Oct 2015 13:36:46 +0000 (13:36 +0000)]
re PR tree-optimization/58497 (SLP vectorizes identical operations)

2015-10-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/58497
* tree-vect-generic.c (ssa_uniform_vector_p): New helper.
(expand_vector_operations_1): Use it.  Lower operations on
all uniform vectors to scalar operations if the HW supports it.

* gcc.dg/tree-ssa/vector-5.c: New testcase.

From-SVN: r229173

9 years agore PR tree-optimization/19049 (not vectorizing a fortran loop)
Richard Biener [Thu, 22 Oct 2015 13:33:17 +0000 (13:33 +0000)]
re PR tree-optimization/19049 (not vectorizing a fortran loop)

2015-10-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/19049
PR tree-optimization/65962
* tree-vect-data-refs.c (vect_analyze_group_access_1): Fall back
to strided accesses if single-element interleaving doesn't work.

* gcc.dg/vect/vect-strided-store-pr65962.c: New testcase.
* gcc.dg/vect/vect-63.c: Adjust.
* gcc.dg/vect/vect-70.c: Likewise.
* gcc.dg/vect/vect-strided-u8-i2-gap.c: Likewise.
* gcc.dg/vect/vect-strided-a-u8-i2-gap.c: Likewise.
* gfortran.dg/vect/pr19049.f90: Likewise.
* gfortran.dg/vect/vect-8.f90: Likewise.

From-SVN: r229172

9 years agore PR middle-end/68046 (-ftrapv doesn't catch leaq-based overflows on x86-64)
Richard Biener [Thu, 22 Oct 2015 11:44:11 +0000 (11:44 +0000)]
re PR middle-end/68046 (-ftrapv doesn't catch leaq-based overflows on x86-64)

2015-10-22  Richard Biener  <rguenther@suse.de>

PR middle-end/68046
PR middle-end/61893
* optabs.c (emit_libcall_block_1): Allow a NULL_RTX equiv.
(expand_binop): For -ftrapv optabs do not record an REG_EQUAL note.
(expand_unop): Likewise.

* gcc.dg/torture/ftrapv-2.c: New testcase.

From-SVN: r229170

9 years agoChangeLog: Fix whitespace.
Uros Bizjak [Thu, 22 Oct 2015 10:16:20 +0000 (12:16 +0200)]
ChangeLog: Fix whitespace.

From-SVN: r229169

9 years agoFix bootstrap on x86_64-apple-darwin14 after r229119.
Max Ostapenko [Thu, 22 Oct 2015 09:47:17 +0000 (12:47 +0300)]
Fix bootstrap on x86_64-apple-darwin14 after r229119.

libsanitizer/

PR bootstrap/68041
* configure.ac (link_sanitizer_common): Link against librt only if it
contains shm_open, required by sanitizers.
(CXX_ABI_NEEDED): Remove variable.
* configure: Regenerate.
* ubsan/Makefile.am (libubsan_la_LIBADD): Do not add -lc++abi anymore.
* ubsan/Makefile.in: Regenerate.

From-SVN: r229168

9 years agofold-const.c (fold_addr_of_array_ref_difference): Properly convert operands before...
Richard Biener [Thu, 22 Oct 2015 08:38:15 +0000 (08:38 +0000)]
fold-const.c (fold_addr_of_array_ref_difference): Properly convert operands before folding a MINUS_EXPR.

2015-10-22  Richard Biener  <rguenther@suse.de>

* fold-const.c (fold_addr_of_array_ref_difference): Properly
convert operands before folding a MINUS_EXPR.
(fold_binary_loc): Move simplification of MINUS_EXPR on
converted POINTER_PLUS_EXPRs ...
* match.pd: ... here.

c/
* c-typeck.c (c_finish_omp_clauses): Properly convert operands
before folding a MINUS_EXPR.

cp/
* semantics.c (cp_finish_omp_clause_depend_sink): Properly convert
before folding a MINUS_EXPR.
(finish_omp_clauses): Likewise.

From-SVN: r229167

9 years agoMove tan simplifications to match.pd
Richard Sandiford [Thu, 22 Oct 2015 08:32:01 +0000 (08:32 +0000)]
Move tan simplifications to match.pd

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_tan): Delete.
(fold_builtin_1): Handle constant tan arguments here.
* match.pd: Simplify (tan (atan x)) to x.

From-SVN: r229166

9 years agoMove more cproj simplifications to match.pd
Richard Sandiford [Thu, 22 Oct 2015 08:27:04 +0000 (08:27 +0000)]
Move more cproj simplifications to match.pd

Also make build_complex_cproj available globally and use
it for the existing match.pd rules.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* builtins.c (fold_builtin_cproj): Delete.
(fold_builtin_1): Handle constant arguments here.
(build_complex_cproj): Move and rename to...
* tree.c: (build_complex_inf): ...this.
* tree.h (build_complex_inf): Declare.
* match.pd: Fold cproj(x)->x if x has no infinity.
Use build_complex_inf for existing cproj rules.

From-SVN: r229164

9 years agoS/390: PR68015 Fix ICE in s390_emit_compare
Andreas Krebbel [Thu, 22 Oct 2015 08:24:01 +0000 (08:24 +0000)]
S/390: PR68015 Fix ICE in s390_emit_compare

gcc/ChangeLog:

2015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/68015
* config/s390/s390.md (mov<mode>cc): Emit compare only if we don't
already have a comparison result.

gcc/testsuite/ChangeLog:

2015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/68015
* gcc.target/s390/pr68015.c: New test.

From-SVN: r229163

9 years ago[PATCH][ARM] Fix for testcase after r228661
Andre Vieira [Thu, 22 Oct 2015 05:12:32 +0000 (05:12 +0000)]
[PATCH][ARM] Fix for testcase after r228661

This patch addresses PR-67948 by changing the xor-and.c test,
initially written for a simplify-rtx pattern, to make it pass post
r228661 (see
https://gcc.gnu.org/ml/gcc-patches/2015-10/msg00676.html). This test
no longer triggered the simplify-rtx pattern it was written for prior
to r228661, though other optimizations did lead to the same assembly
the test checked for. The optimization added with r228661 matches the
pattern used in the test and optimizes it to a better and still valid
sequence. Being unable to easily change the test to trigger the
original simplify-rtx pattern, I chose to change it to pass with the
new produced assembly sequence.

This is correct because the transformation is valid and it yields a
more efficient pattern. However, as I pointed out before this test
doesn't test the optimization it originally was intended for.

Tested by running regression tests for armv6.

Is this OK to commit?

Thanks, Andre

2015-10-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

PR testsuite/67948
* gcc.target/arm/xor-and.c: Adjust test to check for eor
instead of orr.

From-SVN: r229161

9 years ago[Patch AArch64 63304] Fix issue with global state.
Ramana Radhakrishnan [Thu, 22 Oct 2015 04:26:50 +0000 (04:26 +0000)]
[Patch AArch64 63304] Fix issue with global state.

Jiong pointed out privately that there was a thinko
in the way in which the global state was being
set and reset. I don't like adding such
global state but ....

2015-10-22  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

        PR target/63304
        * config/aarch64/aarch64.c (aarch64_nopcrelative_literal_loads): New.
        (aarch64_expand_mov_immediate): Use aarch64_nopcrelative_literal_loads.
        (aarch64_classify_address): Likewise.
        (aarch64_secondary_reload): Likewise.
        (aarch64_override_options_after_change_1): Adjust.
        * config/aarch64/aarch64.md (aarch64_reload_movcp<GPF_TF:mode><P:mode>):
        Use aarch64_nopcrelative_literal_loads.
        (aarch64_reload_movcp<VALL:mode><P:mode>): Likewise.
        * config/aarch64/aarch64-protos.h (aarch64_nopcrelative_literal_loads):
Declare

2015-10-22  Jiong Wang  <jiong.wang@arm.com>
            Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

        PR target/63304
        * gcc.target/aarch64/pr63304_1.c: New test.

From-SVN: r229160

9 years agoDaily bump.
GCC Administrator [Thu, 22 Oct 2015 00:16:11 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r229159

9 years agore PR c++/66781 ("confused by earlier errors, bailing out" with wrong enum within...
Paolo Carlini [Wed, 21 Oct 2015 22:52:45 +0000 (22:52 +0000)]
re PR c++/66781 ("confused by earlier errors, bailing out" with wrong enum within class)

/cp
2015-10-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/66781
* parser.c (cp_parser_enum_specifier): Upon error_at set
nested_name_specifier to error_mark_node; improve error message.

/testsuite
2015-10-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/66781
* g++.dg/parse/enum13.C: New.

/cp
2015-10-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/67847
* parser.c (cp_parser_enum_specifier): Reject a nested_name_specifier
which doesn't name a class or namespace.

/testsuite
2015-10-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/67847
* g++.dg/parse/enum12.C: New.

From-SVN: r229156

9 years agoImprove --help output to generate references to option aliases.
Martin Sebor [Wed, 21 Oct 2015 22:24:41 +0000 (22:24 +0000)]
Improve --help output to generate references to option aliases.

gcc/
PR driver/68043
* opts.c (undocumented_msg, use_diagnosed_msg): New globals.
(print_filtered_help): Reference aliased option's name and encourage
readers to use it in preference to the alias if the former is not
documented.  Mention when using an option is diagnosed.
* gcc.c (display_help): End each sentence with a period.

* ada/gcc-interface/lang.opt: End each sentence that describes
an option with a period.
* c-family/c.opt: Same.
* common.opt: Same.
* config/aarch64/aarch64.opt: Same.
* config/alpha/alpha.opt: Same.
* config/arc/arc.opt: Same.
* config/arm/arm.opt: Same.
* config/avr/avr.opt: Same.
* config/bfin/bfin.opt: Same.
* config/c6x/c6x.opt: Same.
* config/cr16/cr16.opt: Same.
* config/cris/cris.opt: Same.
* config/cris/linux.opt: Same.
* config/darwin.opt: Same.
* config/epiphany/epiphany.opt: Same.
* config/fr30/fr30.opt: Same.
* config/frv/frv.opt: Same.
* config/ft32/ft32.opt: Same.
* config/g.opt: Same.
* config/h8300/h8300.opt: Same.
* config/i386/cygming.opt: Same.
* config/i386/djgpp.opt: Same.
* config/i386/i386.opt: Same.
* config/i386/interix.opt: Same.
* config/i386/mingw-w64.opt: Same.
* config/i386/mingw.opt: Same.
* config/ia64/ia64.opt: Same.
* config/ia64/ilp32.opt: Same.
* config/iq2000/iq2000.opt: Same.
* config/linux.opt: Same.
* config/lm32/lm32.opt: Same.
* config/lynx.opt: Same.
* config/m32c/m32c.opt: Same.
* config/m32r/m32r.opt: Same.
* config/m68k/ieee.opt: Same.
* config/m68k/m68k.opt: Same.
* config/mcore/mcore.opt: Same.
* config/mep/mep.opt: Same.
* config/microblaze/microblaze.opt: Same.
* config/mips/mips.opt: Same.
* config/mmix/mmix.opt: Same.
* config/mn10300/mn10300.opt: Same.
* config/moxie/moxie.opt: Same.
* config/msp430/msp430.opt: Same.
* config/nios2/elf.opt: Same.
* config/nios2/nios2.opt: Same.
* config/nvptx/nvptx.opt: Same.
* config/pa/pa-hpux.opt: Same.
* config/pa/pa-hpux1010.opt: Same.
* config/pa/pa-hpux1111.opt: Same.
* config/pa/pa-hpux1131.opt: Same.
* config/pa/pa.opt: Same.
* config/pa/pa64-hpux.opt: Same.
* config/pdp11/pdp11.opt: Same.
* config/rl78/rl78.opt: Same.
* config/rs6000/476.opt: Same.
* config/rs6000/aix64.opt: Same.
* config/rs6000/darwin.opt: Same.
* config/rs6000/linux64.opt: Same.
* config/rs6000/rs6000.opt: Same.
* config/rs6000/sysv4.opt: Same.
* config/s390/s390.opt: Same.
* config/s390/tpf.opt: Same.
* config/sh/sh.opt: Same.
* config/sol2.opt: Same.
* config/sparc/long-double-switch.opt: Same.
* config/sparc/sparc.opt: Same.
* config/spu/spu.opt: Same.
* config/stormy16/stormy16.opt: Same.
* config/tilegx/tilegx.opt: Same.
* config/tilepro/tilepro.opt: Same.
* config/v850/v850.opt: Same.
* config/vax/vax.opt: Same.
* config/visium/visium.opt: Same.
* config/vms/vms.opt: Same.
* config/vxworks.opt: Same.
* config/xtensa/xtensa.opt: Same.
* fortran/lang.opt: Same.

testsuite/
PR driver/68043
* gcc.misc-tests/help.exp: Adjust.
* lib/options.exp (check_for_options): Add detail to output.

From-SVN: r229155

9 years ago[PATCH 2/9] ENABLE_CHECKING refactoring: libcpp
Mikhail Maltsev [Wed, 21 Oct 2015 22:22:03 +0000 (22:22 +0000)]
[PATCH 2/9] ENABLE_CHECKING refactoring: libcpp

[PATCH 2/9] ENABLE_CHECKING refactoring: libcpp
        * include/line-map.h: Use CHECKING_P instead of ENABLE_CHECKING.
        * init.c: Likewise.
        * macro.c (struct macro_arg_token_iter, set_arg_token,
        macro_arg_token_iter_init, macro_arg_token_iter_forward,
        macro_arg_token_iter_get_token, macro_arg_token_iter_get_location,
        alloc_expanded_arg_mem, _cpp_backup_tokens): Likewise.

From-SVN: r229154

9 years agore PR fortran/67939 (ICE on using data with negative substring range)
Steven G. Kargl [Wed, 21 Oct 2015 21:40:05 +0000 (21:40 +0000)]
re PR fortran/67939 (ICE on using data with negative substring range)

2015-10-21  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/67939
* data.c (create_character_initializer): Deal with zero length string.

2015-10-21  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/67939
* gfortran.dg/pr67939.f90: New test.

From-SVN: r229153

9 years ago* include/std/type_traits (__cpp_lib_bool_constant): Define.
Jonathan Wakely [Wed, 21 Oct 2015 21:20:25 +0000 (22:20 +0100)]
* include/std/type_traits (__cpp_lib_bool_constant): Define.

From-SVN: r229152

9 years agoa scalar depending on vdefs in the current region is not invariant
Aditya Kumar [Wed, 21 Oct 2015 21:18:27 +0000 (21:18 +0000)]
a scalar depending on vdefs in the current region is not invariant

When a scalar is defined in function of an array reference in the current scop,
it does variate.  Graphite cannot represent the condition in scop-11.c, as a[*]
variates in the current region, and it is not an affine condition:

  for (j = 0; j <= 20; j++)
    a[j] = b + i;

  if (a[12] == 23)
    b = 3;
  else
    b = 1;

  for (j = 0; j <= 20; j++)
    a[j] = b + i;

* graphite-scop-detection.c (parameter_index_in_region): Update call to
invariant_in_sese_p_rec.
* graphite-sese-to-poly.c (extract_affine): Same.
* sese.c (invariant_in_sese_p_rec): Pass in an extra parameter has_vdefs.
(scalar_evolution_in_region): Return chrec_dont_know when the scalar variable
depends on virtual definitions in the current region.
* sese.h (invariant_in_sese_p_rec): Update declaration.

testsuite/
* gcc.dg/graphite/scop-11.c: Update pattern.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r229151

9 years agoadd an upper limit on the number of array references
Aditya Kumar [Wed, 21 Oct 2015 21:18:17 +0000 (21:18 +0000)]
add an upper limit on the number of array references

* graphite-scop-detection.c (build_scops): Do not handle scops with more
than PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP arrays.
* params.def (PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP): New.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r229150

9 years ago[PATCH 1/9] ENABLE_CHECKING refactoring
Mikhail Maltsev [Wed, 21 Oct 2015 21:16:31 +0000 (21:16 +0000)]
[PATCH 1/9] ENABLE_CHECKING refactoring

gcc/
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac (CHECKING_P): Define.
* system.h: Use CHECKING_P.

libcpp/
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac (CHECKING_P): Define.
* system.h (fancy_abort): Declare.
(abort): Define.
(gcc_assert): Define. Use CHECKING_P.

From-SVN: r229149

9 years agore PR ipa/67056 (Wrong code generated)
Jan Hubicka [Wed, 21 Oct 2015 21:14:06 +0000 (23:14 +0200)]
re PR ipa/67056 (Wrong code generated)

PR ipa/67056
* ipa-polymorphic-call.c (possible_placement_new): If cur_offset
is negative we don't know the type.
(check_stmt_for_type_change): Skip constructors of non-polymorphic
types as those won't help devirutalization.
* g++.dg/ipa/pr67056.C: New testcase.

From-SVN: r229148

9 years agofold-const.c (operand_equal_p): Add code matching empty constructors.
Jan Hubicka [Wed, 21 Oct 2015 21:12:05 +0000 (23:12 +0200)]
fold-const.c (operand_equal_p): Add code matching empty constructors.

* fold-const.c (operand_equal_p): Add code matching empty
constructors.
* gcc.dg/tree-ssa/operand-equal-1.c: Verify that empty constructors
are matched.

From-SVN: r229147

9 years agotree.def (CEIL_DIV_EXPR, [...]): Tweak comments.
Eric Botcazou [Wed, 21 Oct 2015 21:10:49 +0000 (21:10 +0000)]
tree.def (CEIL_DIV_EXPR, [...]): Tweak comments.

* tree.def (CEIL_DIV_EXPR, FLOOR_DIV_EXPR, ROUND_DIV_EXPR): Tweak
comments.
(TRUNC_MOD_EXPR, CEIL_MOD_EXPR, FLOOR_MOD_EXPR, ROUND_MOD_EXPR):
Add comments on sign of the result.
* fold-const.c (tree_binary_nonnegative_warnv_p) <FLOOR_MOD_EXPR>:
Recurse on operand #1 instead of operand #0.
<CEIL_MOD_EXPR>: Do not recurse.
<ROUND_MOD_EXPR>: Likewise.

From-SVN: r229146

9 years agounconditionally compile most of the delay slot code
Trevor Saunders [Wed, 21 Oct 2015 21:05:02 +0000 (21:05 +0000)]
unconditionally compile most of the delay slot code

gcc/ChangeLog:

2015-10-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* cfgrtl.c (pass_free_cfg::execute): Adjust.
* final.c (dbr_sequence_length): Always define.
(shorten_branches): Adjust.
* genattr-common.c (main): Always define DELAY_SLOTS.
* genattr.c (main): Unconditionally declare functions and define
macros related to delay slots.
* genattrtab.c (write_eligible_delay): Adjust.
(main): Always write out delay slot functions.
* opts.c (default_options_table): Adjust.
* reorg.c (redirect_with_delay_slots_safe_p): Likewise.
(redirect_with_delay_list_safe_p): Likewise.
(fill_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
(rest_of_handle_delay_slots): Likewise.
(pass_delay_slots::gate): Likewise.
* toplev.c (process_options): Likewise.

From-SVN: r229145

9 years agoUpdate documentation for address space hooks
Richard Henderson [Wed, 21 Oct 2015 20:48:46 +0000 (13:48 -0700)]
Update documentation for address space hooks

        * target.def (addr_space.pointer_mode): Update documentation
        of default behavior.
        (addr_space.address_mode): Likewise.
        * tm.texi: Update.

From-SVN: r229144

9 years agoRelax ADDR_SPACE_GENERIC_P checks for default address space hooks
Richard Henderson [Wed, 21 Oct 2015 20:34:47 +0000 (13:34 -0700)]
Relax ADDR_SPACE_GENERIC_P checks for default address space hooks

If all address spaces use the same modes and forms, we would
be forced to replicate these hooks in the backend.  Which would
then require the creation of a new hook to replace
target_default_pointer_address_modes_p.

* targhooks.c (default_addr_space_pointer_mode): Remove check
for generic address space.
(default_addr_space_address_mode): Likewise.
(default_addr_space_valid_pointer_mode): Likewise.
(default_addr_space_legitimate_address_p): Likewise.
(default_addr_space_legitimize_address): Likewise.

From-SVN: r229143

9 years agoChange default of non-overlapping address space conversion
Richard Henderson [Wed, 21 Oct 2015 20:31:26 +0000 (13:31 -0700)]
Change default of non-overlapping address space conversion

The current default of making all undefined coversions being
set to null is not useful.  It has caused all users to lie
and say that spaces are subsets when they are not, just so
that they can override the conversion.

* expr.c (expand_expr_real_2): Use convert_modes on disjoint
address spaces.

From-SVN: r229142

9 years agoMove cabs simplifications to match.pd
Richard Sandiford [Wed, 21 Oct 2015 20:19:25 +0000 (20:19 +0000)]
Move cabs simplifications to match.pd

The fold code also expanded cabs(x+yi) to fsqrt(x*x+y*y) when optimising
for speed.  tree-ssa-math-opts.c has this transformation too, but unlike
the fold code, it first checks whether the target implements the sqrt
optab.  The patch simply removes the fold code and keeps the
tree-ssa-math-opts.c logic the same.

gcc.dg/lto/20110201-1_0.c was relying on us replacing cabs
with fsqrt even on targets where fsqrt is itself a library call.
The discussion leading up to that patch suggested that we only
want to test the fold on targets with a square root instruction,
so it would be OK to skip the test on other targets:

        https://gcc.gnu.org/ml/gcc-patches/2011-07/msg01961.html
        https://gcc.gnu.org/ml/gcc-patches/2011-07/msg02036.html

The patch does that using the sqrt_insn effective target.

It's possible that removing the tree folds renders the LTO trick
unnecessary, but since the test was originally for an ICE, it seems
better to leave it as-is.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
20110201-1_0.c passes on all three.

gcc/
* builtins.c (fold_builtin_cabs): Delete.
(fold_builtin_1): Update accordingly.  Handle constant arguments here.
* match.pd: Add rules previously handled by fold_builtin_cabs.

gcc/testsuite/
* gcc.dg/lto/20110201-1_0.c: Restrict to sqrt_insn targets.
Add associated options for arm*-*-*.
(sqrt): Remove dummy definition.

From-SVN: r229141

9 years agoRemove fold_strip_sign_ops
Richard Sandiford [Wed, 21 Oct 2015 20:16:36 +0000 (20:16 +0000)]
Remove fold_strip_sign_ops

This patch deletes fold_strip_sign_ops in favour of the
gimple-ssa-backprop.c pass.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* fold-const.h (fold_strip_sign_ops): Delete.
* fold-const.c (fold_strip_sign_ops): Likewise.
(fold_unary_loc, fold_binary_loc): Remove calls to it.
* builtins.c (fold_builtin_cos, fold_builtin_cosh)
(fold_builtin_ccos): Delete.
(fold_builtin_pow): Don't call fold_strip_sign_ops.
(fold_builtin_hypot, fold_builtin_copysign): Likewise.
Remove fndecl argument.
(fold_builtin_1): Update calls accordingly.  Handle constant
cos, cosh, ccos and ccosh here.

gcc/testsuite/
* gcc.dg/torture/builtin-symmetric-1.c: Don't run at -O0.

From-SVN: r229140

9 years agoAdd a pass to back-propagate use information
Richard Sandiford [Wed, 21 Oct 2015 20:11:33 +0000 (20:11 +0000)]
Add a pass to back-propagate use information

This patch adds a pass that collects information that is common to
all uses of an SSA name X and back-propagates that information up
the statements that generate X.  The general idea is to use the
information to simplify instructions (rather than a pure DCE) so
I've simply called it gimple-ssa-backprop.c, to go with
tree-ssa-forwprop.c.

At the moment the only use of the pass is to remove unnecessary
sign operations, so that it's effectively a global version of
fold_strip_sign_ops.  I'm hoping it could be extended in future
to record which bits of an integer are significant.  There are
probably other potential uses too.

A later patch gets rid of fold_strip_sign_ops.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
* doc/invoke.texi (-fdump-tree-backprop, -fssa-backprop): Document.
* Makefile.in (OBJS): Add gimple-ssa-backprop.o.
* common.opt (fssa-backprop): New option.
* fold-const.h (negate_mathfn_p): Declare.
* fold-const.c (negate_mathfn_p): Make public.
* timevar.def (TV_TREE_BACKPROP): New.
* tree-pass.h (make_pass_backprop): Declare.
* passes.def (pass_backprop): Add.
* gimple-ssa-backprop.c: New file.

gcc/testsuite/
* gcc.dg/tree-ssa/backprop-1.c, gcc.dg/tree-ssa/backprop-2.c,
gcc.dg/tree-ssa/backprop-3.c, gcc.dg/tree-ssa/backprop-4.c,
gcc.dg/tree-ssa/backprop-5.c, gcc.dg/tree-ssa/backprop-6.c: New tests.

From-SVN: r229139

9 years agoavoid generation of empty guards in trivial cases
Aditya Kumar [Wed, 21 Oct 2015 18:53:35 +0000 (18:53 +0000)]
avoid generation of empty guards in trivial cases

We used to insert a trivial integer_onep condition around loops we know have
more than an iteration.  This patch avoids generating those conditions.

* graphite-isl-ast-to-gimple.c (graphite_create_new_loop_guard): Do not call
create_empty_if_region_on_edge when cond_expr is true.
(translate_isl_ast_node_for): Check whether a guard has been generated.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r229137

9 years agoRefactor graphite-sese-to-poly, sese.h, graphite-poly.h
Aditya Kumar [Wed, 21 Oct 2015 18:53:26 +0000 (18:53 +0000)]
Refactor graphite-sese-to-poly, sese.h, graphite-poly.h

Now that scop contains a list of all the basic blocks inside, it makes sense to
iterate over only those basic blocks in
graphite-sese-to-poly.c:rewrite_reductions_out_of_ssa,rewrite_cross_bb_scalar_deps_out_of_ssa

Passes regtest and bootstrap.

gcc/ChangeLog:

2015-10-20  Aditya Kumar  <hiraditya@msn.com>

        * graphite-poly.h (struct dr_info): Added invalid_alias_set number.
        (operator=): Removed.
        (dr_info): Make alias_set number the last argument with default value of invalid_alias_set.
        * graphite-sese-to-poly.c (build_scop_drs): Update constructor of dr_info.
        (rewrite_reductions_out_of_ssa): Iterate only through the basic blocks which are inside region.
        (rewrite_cross_bb_scalar_deps_out_of_ssa): Same.
        * sese.h (struct sese_l): Removed assignment operator.
        (split_region_for_bb): Removed dead code.

From-SVN: r229136

9 years agoRefactoring sese.h and graphite-poly.h
Aditya Kumar [Wed, 21 Oct 2015 18:53:17 +0000 (18:53 +0000)]
Refactoring sese.h and graphite-poly.h

Rename scop->region to scop->scop_info
Removed conversion constructors for sese_l and dr_info.
Removed macros.

No functional changed intended. Passes regtest and bootstrap.

gcc/ChangeLog:

2015-19-10  Aditya Kumar  <aditya.k7@samsung.com>
        * graphite-poly.h (struct dr_info): Removed conversion constructor.
        (struct scop): Renamed scop::region to scop::scop_info
        (scop_set_region): Same.
        (SCOP_REGION): Removed
        (SCOP_CONTEXT): Removed.
        (POLY_SCOP_P): Removed.
        * graphite-isl-ast-to-gimple.c (translate_isl_ast_node_user):
        Rename scop->region to scop->scop_info.
        (add_parameters_to_ivs_params): Same.
        (graphite_regenerate_ast_isl): Same.
        * graphite-poly.c (new_scop): Same.
        (free_scop): Same.
        (print_scop_params): Same.
        * graphite-scop-detection.c (scop_detection::remove_subscops): Same.
        (scop_detection::remove_intersecting_scops): Use pointer to sese_l.
        (dot_all_scops_1): Rename scop->region to scop->scop_info.
        (scop_detection::nb_pbbs_in_loops): Same.
        (find_scop_parameters): Same.
        (try_generate_gimple_bb): Same.
        (gather_bbs::before_dom_children): Same.
        (gather_bbs::after_dom_children): Same.
        (build_scops): Same.
        * graphite-sese-to-poly.c (build_scop_scattering): Same.
        (extract_affine_chrec): Same.
        (extract_affine): Same.
        (set_scop_parameter_dim): Same.
        (build_loop_iteration_domains): Same.
        (create_pw_aff_from_tree): Same.
        (add_param_constraints): Same.
        (build_scop_iteration_domain): Same.
        (build_scop_drs): Same.
        (analyze_drs_in_stmts): Same.
        (insert_out_of_ssa_copy_on_edge): Same.
        (rewrite_close_phi_out_of_ssa):Same.
        (rewrite_reductions_out_of_ssa):Same.
        (handle_scalar_deps_crossing_scop_limits):Same.
        (rewrite_cross_bb_scalar_deps):Same.
        (rewrite_cross_bb_scalar_deps_out_of_ssa):Same.
        (build_poly_scop):Same.
        (build_alias_set): Use pointer to dr_info.
        * graphite.c (print_graphite_scop_statistics):
        (graphite_transform_loops):
        * sese.h (struct sese_l): Remove conversion constructor.

From-SVN: r229135

9 years agoAdd --param sra-max-scalarization-size-Ospeed to sra-12.c
Alan Lawrence [Wed, 21 Oct 2015 18:41:43 +0000 (18:41 +0000)]
Add --param sra-max-scalarization-size-Ospeed to sra-12.c

* gcc.dg/tree-ssa/sra-12.c: Enable test on all targets; add --param
sra-max-scalarization-size-Ospeed.

From-SVN: r229134

9 years agore PR middle-end/67966 (ICE in convert_move, at expr.c:282)
Jan Hubicka [Wed, 21 Oct 2015 18:00:30 +0000 (20:00 +0200)]
re PR middle-end/67966 (ICE in convert_move, at expr.c:282)

PR middle-end/67966
* tree.c (verify_type): Verify that TYPE_MODE match
  between TYPE_CANONICAL and type.
  * expr.c (store_expr_with_bounds): Revert my previous change.
  * expmed.c (store_bit_field_1): Revert prevoius change.
  * gimple-expr.c (useless_type_conversion_p): Require TYPE_MODE
  to match for all types.

From-SVN: r229132

9 years agore PR c/68024 (Diagnose variadic functions defined without prototypes)
Marek Polacek [Wed, 21 Oct 2015 17:30:20 +0000 (17:30 +0000)]
re PR c/68024 (Diagnose variadic functions defined without prototypes)

PR c/68024
* c-decl.c (start_function): Warn about vararg functions without
a prototype.

* gcc.dg/pr68024.c: New test.

From-SVN: r229131

9 years agoomp-low.c (check_omp_nesting_restrictions): Check OpenACC loop nesting.
Nathan Sidwell [Wed, 21 Oct 2015 16:14:01 +0000 (16:14 +0000)]
omp-low.c (check_omp_nesting_restrictions): Check OpenACC loop nesting.

gcc/
* omp-low.c (check_omp_nesting_restrictions): Check OpenACC loop
nesting.

testsuite/
* c-c++-common/goacc/clauses-fail.c: Adjust errors.
* c-c++-common/goacc/sb-1.c: Adjust errors.
* c-c++-common/goacc/sb-3.c: Adjust errors.
* c-c++-common/goacc/loop-1.c: Adjust errors.
* c-c++-common/goacc/nesting-1.c: Adjust errors.
* c-c++-common/goacc-gomp/nesting-fail-1.c: Adjust errors.
* c-c++-common/goacc-gomp/nesting-1.c: Adjust errors.

From-SVN: r229129

9 years agotm.texi: Regenerated.
Ilya Enkovich [Wed, 21 Oct 2015 16:01:43 +0000 (16:01 +0000)]
tm.texi: Regenerated.

gcc/

* doc/tm.texi: Regenerated.
* doc/tm.texi.in (TARGET_VECTORIZE_GET_MASK_MODE): New.
* stor-layout.c (layout_type): Use mode to get vector mask size.
* target.def (get_mask_mode): New.
* targhooks.c (default_get_mask_mode): New.
* targhooks.h (default_get_mask_mode): New.
* gcc/tree-vect-stmts.c (get_same_sized_vectype): Add special case
for boolean vector.
* tree.c (MAX_BOOL_CACHED_PREC): New.
(nonstandard_boolean_type_cache): New.
(build_nonstandard_boolean_type): New.
(make_vector_type): Vector mask has no canonical type.
(build_truth_vector_type): New.
(build_same_sized_truth_vector_type): New.
(truth_type_for): Support vector masks.
* tree.h (VECTOR_BOOLEAN_TYPE_P): New.
(build_truth_vector_type): New.
(build_same_sized_truth_vector_type): New.
(build_nonstandard_boolean_type): New.
* tree-cfg.c (verify_gimple_comparison) Require boolean
vector type for vector comparison.
(verify_gimple_assign_ternary): Likewise.
* optabs.c (expand_vec_cond_expr): Accept boolean vector as
condition operand.
* tree-vect-stmts.c (vectorizable_condition): Use boolean
vector type for vector comparison.
* tree-vect-generic.c (elem_op_func): Add new operand to hold
vector type.
(do_unop): Adjust to modified function type.
(do_binop): Likewise.
(do_plus_minus): Likewise.
(do_negate); Likewise.
(expand_vector_piecewise): Likewise.
(do_cond): Likewise.
(do_compare): Use comparison instead of condition.
(expand_vector_divmod): Use boolean vector type for comparison.
(expand_vector_operations_1): Skip scalar mask operations.

gcc/c

* c-typeck.c (build_conditional_expr): Use boolean vector
type for vector comparison.
(build_vec_cmp): New.
(build_binary_op): Use build_vec_cmp for comparison.

gcc/cp

* call.c (build_conditional_expr_1): Use boolean vector
type for vector comparison.
* typeck.c (build_vec_cmp): New.
(cp_build_binary_op): Use build_vec_cmp for comparison.

gcc/testsuite/

* g++.dg/ext/vector22.C: Allow VEC_COND_EXPR.

From-SVN: r229128

9 years agoomp-low.c (simd_clone_create): Set in_other_partition for created clones.
Ilya Enkovich [Wed, 21 Oct 2015 15:57:00 +0000 (15:57 +0000)]
omp-low.c (simd_clone_create): Set in_other_partition for created clones.

gcc/

* omp-low.c (simd_clone_create): Set in_other_partition
for created clones.

gcc/testsuite/

* gcc.dg/lto/simd-function_0.c: New test.

From-SVN: r229127