PR c/58346
c-family/
* c-common.c (pointer_to_zero_sized_aggr_p): New function.
* c-common.h: Declare it.
cp/
* typeck.c (pointer_diff): Give an error on arithmetic on pointer to
an empty aggregate.
c/
* c-typeck.c (pointer_diff): Give an error on arithmetic on pointer to
an empty aggregate.
testsuite/
* c-c++-common/pr58346-1.c: New test.
* c-c++-common/pr58346-2.c: New test.
* c-c++-common/pr58346-3.c: New test.
From-SVN: r207004
2014-01-23 Robert Dewar <dewar@adacore.com>
* opt.adb (Register_Opt_Config_Switches): Save SPARK_Mode_Pragma
setting.
2014-01-23 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Is_Potentially_Unevaluated): Predicate only
applies to expressions that come from source.
* sem_attr.adb (Analyze_Attribute, case 'Old): Improve error
message.
(Analyze_Attribute, case 'Loop_Entry): Apply SPARK 2014 legality
rule regarding potentially unevaluated expressions, to prefix
of attribute.
From-SVN: r206993
2014-01-23 Ed Schonberg <schonberg@adacore.com>
* exp_util.adb (Make_Invqriant_Call): If type of expression is
a private extension, get invariant from base type.
2014-01-23 Robert Dewar <dewar@adacore.com>
* sem_util.adb, sem_attr.adb: Minor reformatting.
2014-01-23 Robert Dewar <dewar@adacore.com>
* opt.adb (Save_Opt_Config_Switches): Save SPARK_Mode_Pragma
(Restore_Opt_Config_Switches): Restore SPARK_Mode_Pragma.
* sem.adb (Semantics): Remove save/restore of
SPARK_Mode[_Pragma]. Not needed since already done in
Save/Restore_Opt_Config_Switches.
2014-01-23 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi, einfo.adb, einfo.ads, sem_prag.adb, gnat_ugn.texi,
freeze.adb, repinfo.adb, aspects.adb, aspects.ads, sem_ch13.adb:
Linker_Section enhancements.
From-SVN: r206992
Fix for PR c/59825.
2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
PR c/59825
* c-array-notation.c (expand_array_notation_exprs): Rewrote this
function to use walk_tree and moved a lot of its functionality to
expand_array_notations.
(expand_array_notations): New function.
From-SVN: r206991
2014-01-23 Tristan Gingold <gingold@adacore.com>
* gnat_rm.texi: Minor editing.
2014-01-23 Robert Dewar <dewar@adacore.com>
* opt.adb (Set_Opt_Config_Switches): Reset SPARK mode for
with'ed internal units.
* sem.adb (Semantics): Save and restore SPARK_Mode[_Pragma].
2014-01-23 Javier Miranda <miranda@adacore.com>
* lib-xref.adb (Generate_Reference): As part of processing the
"end-of-spec" reference generate an extra reference to the first
private entity of the package.
* xr_tabls.adb (Add_Reference): No action needed for the extra
'E' reference associated; similar to the processing of the
'e' reference.
2014-01-23 Bob Duff <duff@adacore.com>
* gnat_ugn.texi: Change "--&pp off" to "--!pp off".
2014-01-23 Ed Schonberg <schonberg@adacore.com>
* sem_util.ads, sem_util.adb (Is_Potentially_Unevaluated): new
predicate to implement rule given in 6.1.1 (20/3).
* sem_attr.adb (Analyze_Attribute, case 'Old): Reject prefix of
'Old in a postcondition, if it is potentially unevaluated and
it is not an entity name.
From-SVN: r206990
2014-01-23 Robert Dewar <dewar@adacore.com>
* gnatlink.adb (Gnatlink): Fix problem of generating bad name
msg on VMS.
2014-01-23 Bob Duff <duff@adacore.com>
* g-dynhta.ads: Minor comment fix.
2014-01-23 Yannick Moy <moy@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Inherit SPARK_Mode
from spec on body only when not already inherited on spec. Set
SPARK_Mode from context on body without previous spec. *
* sem_prag.adb (Analyze_Pragma): Check placement of pragma on
library-level entities. Correct retrieval of entity from
declaration, for cases where the declaration is not a unit.
* sem_ch12.adb (Instantiate_Object): Avoid
calling Is_Volatile_Object on an empty node.
From-SVN: r206987
2014-01-23 Robert Dewar <dewar@adacore.com>
* gnatlink.adb (Gnatlink): Check for suspicious executable file
names on windows.
2014-01-23 Robert Dewar <dewar@adacore.com>
* a-ngelfu.ads: Remove bad uses of AND which should be AND THEN.
* sem_res.adb (Check_No_Direct_Boolean_Operators): Don't give
style errors in instances.
* g-dynhta.ads (Static_HTable): Comment updates.
From-SVN: r206986
2014-01-23 Vincent Celier <celier@adacore.com>
* prj-conf.adb (Get_Or_Create_Configuration_File): Do not attempt
to find a configuration project file when Config_File_Name is
No_Configuration_File.
* prj-conf.ads (No_Configuration_File): New constant String.
* prj-pars.adb (Parse): Call Get_Or_Create_Configuration_File
with Config_File_Name set to No_Configuration_File, so that
no existing configuration project file will be used, and the
configuration project will be only created in memory when
Add_Default_GNAT_Naming_Scheme is called.
* projects.texi: Minor reformatting.
From-SVN: r206985
2014-01-23 Vincent Celier <celier@adacore.com>
* prj-conf.adb (Get_Or_Create_Configuration_File): Never parse
a config project file if On_Load_Config is not null.
* prj-pars.adb: Minor comment changes.
From-SVN: r206984
2014-01-23 Robert Dewar <dewar@adacore.com>
* exp_util.adb, sinfo.adb, sinfo.ads, sem.adb, sem_res.adb,
expander.adb, exp_ch11.adb, exp_ch11.ads, sem_ch11.adb, sem_ch11.ads,
sprint.adb, sprint.ads: Remove unused node N_Subprogram_Info.
2014-01-23 Emmanuel Briot <briot@adacore.com>
* prj-conf.adb (Get_Or_Create_Configuration_File): call
On_Load_Config later.
2014-01-23 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Do not
generate the spec of the late primitive in ASIS mode. Add two
comments to explain the special cases when the expansion is
not performed.
2014-01-23 Robert Dewar <dewar@adacore.com>
* sem_util.adb (Note_Possible_Modification): Fix error of
misbehaving for implicit dereference cases in -gnatc mode.
2014-01-23 Emmanuel Briot <briot@adacore.com>
* prj-pars.adb: Minor reformatting.
From-SVN: r206980
* config/msp430/msp430.h (ASM_SPEC): Pass the -mcpu as -mcpu.
(LIB_SPEC): Drop use of memory.ld and peripherals.ld scripts in
favour of mcu specific scripts.
* config/msp430/t-msp430 (MULTILIB_MATCHES): Add more matches for
430x multilibs.
From-SVN: r206977
gcc/c/c-parser.c
2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
* c-parser.c (c_finish_omp_declare_simd): Made "cilk simd function"
attribute an attribute without value.
gcc/cp/ChangeLog
2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
* parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
see if there is an attribute after function decl. If so, then
parse them now.
(cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
enabled function late parsing.
(cp_parser_gnu_attribute_list): Parse all the tokens for the vector
attribute for a SIMD-enabled function.
(cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
the function is used by SIMD-enabled function (indicated by NULL
pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
(cp_parser_cilk_simd_vectorlength): Modified this function to handle
vectorlength clause in SIMD-enabled function and #pragma SIMD's
vectorlength clause. Added a new bool parameter to differentiate
between the two.
(cp_parser_cilk_simd_fn_vector_attrs): New function.
(is_cilkplus_vector_p): Likewise.
(cp_parser_late_parsing_elem_fn_info): Likewise.
(cp_parser_omp_clause_name): Added a check for "mask", "nomask"
and "vectorlength" clauses when Cilk Plus is enabled.
(cp_parser_omp_clause_linear): Added a new parameter of type bool
and emit a sorry message when step size is a parameter.
* parser.h (cp_parser::cilk_simd_fn_info): New field.
* decl.c (grokfndecl): Added flag_enable_cilkplus along with
flag_openmp.
* pt.c (apply_late_template_attributes): Likewise.
testsuite/ChangeLog
2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
* g++.dg/cilk-plus/cilk-plus.exp: Called the C/C++ common tests for
SIMD enabled function.
* g++.dg/cilk-plus/ef_test.C: New test.
* c-c++-common/cilk-plus/ef_error3.c: Made certain messages C specific
and added C++ ones.
* c-c++-common/cilk-plus/vlength_errors.c: Added new dg-error tags
to differenciate C error messages from C++ ones.
From-SVN: r206975
2013-01-23 Alex Velenko <Alex.Velenko@arm.com>
* config/aarch64/aarch64-simd.md
(aarch64_be_checked_get_lane<mode>): New define_expand.
* config/aarch64/aarch64-simd-builtins.def
(BUILTIN_VALL (GETLANE, be_checked_get_lane, 0):
New builtin definition.
* config/aarch64/arm_neon.h: (__aarch64_vget_lane_any):
Use new safe be builtin.
From-SVN: r206970
In this problem report, the compiler is fed a (bogus) translation unit
in which some literals contain bytes whose value is zero. The
preprocessor detects that and proceeds to emit diagnostics for that
king of bogus literals. But then when the diagnostics machinery
re-reads the input file again to display the bogus literals with a
caret, it attempts to calculate the length of each of the lines it got
using fgets. The line length calculation is done using strlen. But
that doesn't work well when the content of the line can have several
zero bytes. The result is that the read_line never sees the end of
the line because strlen repeatedly reports that the line ends before
the end-of-line character; so read_line thinks its buffer for reading
the line is too small; it thus increases the buffer, leading to a huge
memory consumption and disaster.
Here is what this patch does.
location_get_source_line is modified to return the length of a source
line that can now contain bytes with zero value.
diagnostic_show_locus() is then modified to consider that a line can
have characters of value zero, and so just shows a white space when
instructed to display one of these characters.
Additionally location_get_source_line is modified to avoid re-reading
each and every line from the beginning of the file until it reaches
the line number N that it is instructed to get; this was leading to
annoying quadratic behaviour when reading adjacent lines near the end
of (big) files. So a cache is now associated to the file opened in
text mode. When the content of the file is read, that content is
stashed in the file cache. That file cache is searched for line
delimiters. A number of line positions are saved in the cache and a
number of file caches are kept in memory. That way when
location_get_source_line is asked to read line N + 1, it just has to
start reading from line N that it has already read.
libcpp/ChangeLog:
* include/line-map.h (linemap_get_file_highest_location): Declare
new function.
* line-map.c (linemap_get_file_highest_location): Define it.
gcc/ChangeLog:
* input.h (location_get_source_line): Take an additional line_size
parameter.
(void diagnostics_file_cache_fini): Declare new function.
* input.c (struct fcache): New type.
(fcache_tab_size, fcache_buffer_size, fcache_line_record_size):
New static constants.
(diagnostic_file_cache_init, total_lines_num)
(lookup_file_in_cache_tab, evicted_cache_tab_entry)
(add_file_to_cache_tab, lookup_or_add_file_to_cache_tab)
(needs_read, needs_grow, maybe_grow, read_data, maybe_read_data)
(get_next_line, read_next_line, goto_next_line, read_line_num):
New static function definitions.
(diagnostic_file_cache_fini): New function.
(location_get_source_line): Take an additional output line_len
parameter. Re-write using lookup_or_add_file_to_cache_tab and
read_line_num.
* diagnostic.c (diagnostic_finish): Call
diagnostic_file_cache_fini.
(adjust_line): Take an additional input parameter for the length
of the line, rather than calculating it with strlen.
(diagnostic_show_locus): Adjust the use of
location_get_source_line and adjust_line with respect to their new
signature. While displaying a line now, do not stop at the first
null byte. Rather, display the zero byte as a space and keep
going until we reach the size of the line.
* Makefile.in: Add vec.o to OBJS-libcommon
gcc/testsuite/ChangeLog:
* c-c++-common/cpp/warning-zero-in-literals-1.c: New test file.
Signed-off-by: Dodji Seketeli <dodji@seketeli.org>
From-SVN: r206957
2014-01-22 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/59477
* lra-constraints.c (inherit_in_ebb): Process call for living hard
regs. Update reloads_num and potential_reload_hard_regs for all
insns.
2014-01-22 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/59477
* g++.dg/pr59477.C: New.
From-SVN: r206938
/cp
2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/59482
* parser.c (cp_parser_class_head): Push the class before parsing
the base-clause, pop after it.
/testsuite
2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/59482
* g++.dg/pr59482.C: New.
From-SVN: r206933
2014-01-22 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): A subprogram
body generated for an expression function within a protected body
needs a set of renaming declarations if the expression function
comes from source.
2014-01-22 Ed Schonberg <schonberg@adacore.com>
* lib-xref.adb (Get_Type_Reference): In semantics-only mode,
list interface progenitor of a tagged concurrent type, for better
source navigation.
2014-01-22 Robert Dewar <dewar@adacore.com>
* lib.adb (In_Extended_Main_Code_Unit): Return False for
Standard_Location.
(In_Extended_Main_Source_Unit): Return False for Standard_Location.
* lib.ads (In_Extended_Main_Code_Unit): Add documentation on
treatment of Slocs No_Location and Standard_Location.
* restrict.adb (Check_Restriction_No_Dependence): Explicitly
check for entity with Standard_Location Sloc, rather than relying
on Lib routines to do that.
* sem_res.adb (Resolve_Call): Implement SPARK_05 restriction
that a call cannot occur before a later occuring body within
the same unit.
From-SVN: r206931