Dodji Seketeli [Mon, 30 Apr 2012 11:43:29 +0000 (11:43 +0000)]
Adjust relevant test cases wrt -ftrack-macro-expansion=[0|2]
Even after all the patches I have already submitted, some test cases
where errors happens on tokens that are defined in macros see their
output change in an incompatible way, when you run them with or
without -ftrack-macro-expansion.
I think this is expected, because the (spelling) locus inside the
definition of the macro pointed to with -ftrack-macro-expansion is
different from the locus of the expansion point of the macro pointed
to without -ftrack-macro-expansion.
In those cases this patch either adjusts the test case and forces it
be run either with -ftrack-macro-expansion, or it just forces it to be
run without -ftrack-macro-expansion.
There are so many libstdc++ tests that were failing because of that
benign issue that I preferred to just run them with
-ftrack-macro-expansion diabled, after inspecting each of them to be
sure there was nothing more serious underneath.
Boostrapped on x86_64-unknown-linux-gnu against trunk with and without
-ftrack-macro-expansion turned on.
gcc/testsuite/
* objc.dg/foreach-7.m: Force the test case to run without
-ftrack-macro-expansion.
* c-c++-common/tm/attrib-1.c: Likewise.
* c-c++-common/warn-ommitted-condop.c: Likewise.
* gcc.dg/assign-warn-1.c: Likewise.
* gcc.dg/assign-warn-2.c: Likewise.
* gcc.dg/attr-alloc_size.c: Likewise.
* gcc.dg/builtin-stringop-chk-1.c: Likewise.
* gcc.dg/builtin-stringop-chk-2.c: Likewise.
* gcc.dg/builtin-strncat-chk-1.c: Likewise.
* gcc.dg/c90-const-expr-9.c: Likewise.
* gcc.dg/c99-const-expr-9.c: Likewise.
* gcc.dg/cpp/direct2.c: Likewise. Adjust.
* gcc.dg/cpp/direct2s.c: Likewise.
* gcc/testsuite/gcc.dg/cpp/pr28709.c: Likewise.
* gcc.dg/cpp/pragma-diagnostic-1.c: Likewise.
* gcc.dg/dfp/composite-type.c: Likewise.
* gcc.dg/uninit-6-O0.c: Adjust the test case and force it to run
with -ftrack-macro-expansion
* g++.dg/cpp0x/constexpr-ex3.C: Likewise.
* g++.dg/cpp0x/constexpr-overflow.C: Likewise.
* g++.dg/ext/cleanup-1.C: Likewise.
* g++.dg/ext/gnu-inline-global-reject.C: Likewise.
* g++.dg/template/sfinae10.C: Likewise.
* g++.dg/tm/wrap-2.C: Likewise.
* g++.dg/warn/Wconversion-real-integer.C: Likewise.
* g++.dg/warn/Wsign-conversion.C: Likewise.
* g++.dg/warn/multiple-overflow-warn-1.C: Likewise.
* g++.old-deja/g++.mike/p10769b.C: Likewise.
* g++.dg/warn/Wdouble-promotion.C: Adjust the test case and force
it to run with -ftrack-macro-expansion.
* libstdc++-v3/scripts/testsuite_flags.in: By default, run the
test cases without -ftrack-macro-expansion.
From-SVN: r186976
Dodji Seketeli [Mon, 30 Apr 2012 11:43:14 +0000 (11:43 +0000)]
Fix va_start related location
In gcc/testsuite/gcc.dg/pr30457.c, the first warning was not being
emitted because the relevant location was inside the var_start macro
defined in a system header. It can even point to a token for a
builtin macro there. This patch unwinds to the first token in real
source code in that case.
Tested on x86_64-unknown-linux-gnu against trunk.
* builtins.c (fold_builtin_next_arg): Unwinds to the first
location in real source code.
From-SVN: r186975
Dodji Seketeli [Mon, 30 Apr 2012 11:43:02 +0000 (11:43 +0000)]
Fix location for static class members
Consider the test case g++.dg/other/offsetof5.C:
#include <stddef.h>
struct A
{
char c;
int &i;
};
int j = offsetof (A, i); // { dg-warning "invalid access|offsetof" }
template <typename T>
struct S
{
T h;
T &i;
static const int j = offsetof (S, i); // { dg-warning "invalid access|offsetof" }
};
int k = S<int>::j; // { dg-message "required from here" }
The second warning (that involves the instantiation of the S template)
is not emitted when -ftrack-macro-expansion is on.
This is because during the instantiation of the member j of S
template, the location that is used for the warning is the one for the
DECL j (set by instantiate_decl). And that location is inaccurately
set to the locus of 'offsetof', which is a macro defined in a system
header, so it's discarded by the diagnostics machinery.
Note that when we reach the point where we emit the warning in
build_class_member_access_expr offsetof expression has long been
folded, so we cannot use e.g, the location of the ')' token that would
have been in the source code. So I believe the location of 'j' is the
best we can get at this point.
The patch below sets the location of the DECL for 'j' to what I
believe is its precise location; with that, the test case passes with
and without -ftrack-macro-expansion. But I had to adjust
g++.dg/template/sfinae6_neg.C for that.
Tested on x86_64-unknown-linux-gnu against trunk.
gcc/cp
* decl.c (grokdeclarator): Use the location carried by the
declarator for the DECL of the static class member.
gcc/testsuite/
* g++.dg/template/sfinae6_neg.C: Adjust.
From-SVN: r186974
Dodji Seketeli [Mon, 30 Apr 2012 11:42:50 +0000 (11:42 +0000)]
Fix va_arg type location
Now that diagnostics first point to the spelling location of tokens
coming from macro expansion, the test case
gcc/testsuite/g++.old-deja/g++.other/vaarg3.C shows that when I write
va_args (args, some_type), the location that is recorded for
"some_type" is not correct. We wrongly record a location that is in
the system header where the va_args macro is defined.
This patch changes that to correctly record the location for the type
operand of the va_arg expression.
With this patch applied, the
gcc/testsuite/g++.old-deja/g++.other/vaarg3.C test PASSes with and
without -ftrack-macro-expansion.
Tested on x86_64-unknown-linux-gnu against trunk.
Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches. This patch
just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
gcc/cp/
* cp-tree.h (build_x_va_arg): Take an additional location
parameter.
* call.c (build_x_va_arg): Take a loc parameter for the location
of the type of the va_arg expression.
* parser.c (cp_parser_primary_expression): Pass the type of the
type in the va_arg expression to build_x_va_arg.
* pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
From-SVN: r186973
Dodji Seketeli [Mon, 30 Apr 2012 11:42:38 +0000 (11:42 +0000)]
Make conversion warnings work on NULL with -ftrack-macro-expansion
There are various conversion related warnings that trigger on
potentially dangerous uses of NULL (or __null). NULL is defined as a
macro in a system header, so calling warning or warning_at on a
virtual location of NULL yields no diagnostic. So the test
accompanying this patch (as well as others), was failling when run
with -ftrack-macro-expansion.
I think it's necessary to use the location of NULL that is in the main
source code (instead of, e.g, the spelling location that is in the
system header where the macro is defined) in those cases. Note that
for __null, we don't have the issue.
I have augmented the test of this patch to check that we don't regress
when handling __null.
Tested on x86_64-unknown-linux-gnu against trunk.
Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches. This patch
just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
gcc/
* input.h (expansion_point_location_if_in_system_header): Declare
new function.
* input.c (expansion_point_location_if_in_system_header): Define it.
gcc/cp/
* call.c (conversion_null_warnings): Use the new
expansion_point_location_if_in_system_header.
* cvt.c (build_expr_type_conversion): Likewise.
* typeck.c (cp_build_binary_op): Likewise.
gcc/testsuite/
* g++.dg/warn/Wconversion-null-2.C: Add testing for __null,
alongside the previous testing for NULL.
From-SVN: r186972
Dodji Seketeli [Mon, 30 Apr 2012 11:42:25 +0000 (11:42 +0000)]
Fix -Wuninitialized for -ftrack-macro-expansion
Besides the warning emitted by warn_uninit, this function wants
to hint the user at where the uninitialized variable was declared, for
cases where the declaration location is outside the current function.
Now that expand_location expands to the location that is in the main
source file (even for -ftrack-macro-expansion) the hinting part was
not working well for cases where the variable is declared in a macro
(outside the function), which is then expanded in the function.
So I had to adjust warn_uninit a little bit to make it consider the
spelling location of the variable declaration.
I have fixed the test gcc.dg/cpp/pragma-diagnostic-2.c on which I
believe gcc shouldn't emit any error.
Here is the new output on that test:
=~=
gcc.dg/cpp/pragma-diagnostic-2.c: In function 'g':
gcc.dg/cpp/pragma-diagnostic-2.c:10:5: warning: 'a' is used uninitialized in this function [-Wuninitialized]
gcc.dg/cpp/pragma-diagnostic-2.c:9:7: note: 'a' was declared here
gcc.dg/cpp/pragma-diagnostic-2.c:9:7: note: in expansion of macro 'CODE_WITH_WARNING'
gcc.dg/cpp/pragma-diagnostic-2.c:17:3: note: expanded from here
gcc.dg/cpp/pragma-diagnostic-2.c: In function 'h':
gcc.dg/cpp/pragma-diagnostic-2.c:10:5: warning: 'a' is used uninitialized in this function [-Wuninitialized]
gcc.dg/cpp/pragma-diagnostic-2.c:9:7: note: 'a' was declared here
gcc.dg/cpp/pragma-diagnostic-2.c:9:7: note: in expansion of macro 'CODE_WITH_WARNING'
gcc.dg/cpp/pragma-diagnostic-2.c:27:3: note: expanded from here
=~=
Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.
Note that the bootstrap with -ftrack-macro-expansion turned on
exhibits other separate issues that are addressed in subsequent
patches. This patch just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
gcc/
* tree-ssa.c (warn_uninit): Use the spelling location of the
variable declaration. Use linemap_location_before_p for source
locations.
gcc/testsuite/
* gcc.dg/cpp/pragma-diagnostic-2.c: Fix this.
From-SVN: r186971
Dodji Seketeli [Mon, 30 Apr 2012 11:42:12 +0000 (11:42 +0000)]
Strip "<built-in>" loc from displayed expansion context
Now that diagnostics for tokens coming from macro expansions point to
the spelling location of the relevant token (and then displays the
context of the expansion), some ugly (not so seldom) corner cases can
happen.
When the relevant token is a built-in token (which means the location
of that token is BUILTINS_LOCATION) the location prefix displayed to
the user in the diagnostic line is the "<built-in>:0:0" string. For
instance:
<built-in>:0:0: warning: conversion to 'float' alters 'int' constant value
For the user, I think this is surprising and useless.
A more user-friendly approach would be to refer to the first location
that (in the reported macro expansion context) is for a location in
real source code, like what is shown in the new test case
gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C accompanying
this patch.
To do this, I am making the line-map module provide a new
linemap_unwind_to_first_non_reserved_loc function that resolves a
virtual location to the first spelling location that is in real source
code.
I am then using that facility in the diagnostics printing module and
in the macro unwinder to avoid printing diagnostics lines that refer
to the locations for built-ins or more generally for reserved
locations. Note that when I start the dance of skipping a built-in
location I also skip locations that are in system headers, because it
turned out that a lot of those built-ins are actually used in system
headers (e.g, "#define INT_MAX __INT_MAX__" where __INT_MAX__ is a
built-in).
Besides the user-friendliness gain, this patch allows a number of
regression tests to PASS unchanged with and without
-ftrack-macro-expansion.
Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.
Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches. This patch
just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
libcpp/
* include/line-map.h (linemap_unwind_toward_expansion): Fix typo
in comment.
(linemap_unwind_to_first_non_reserved_loc): Declare new function.
* line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
new function.
gcc/
* input.c (expand_location_1): When expanding to spelling location
in a context of a macro expansion, skip reserved system header
locations. Update comments. * tree-diagnostic.c
(maybe_unwind_expanded_macro_loc): Likewise.
gcc/testsuite/
* g++.dg/warn/Wconversion-real-integer2.C: New test.
* g++.dg/warn/Wconversion-real-integer-3.C: Likewise.
* g++.dg/warn/conversion-real-integer-3.h: New header used by the
new test above.
From-SVN: r186970
Dodji Seketeli [Mon, 30 Apr 2012 11:42:00 +0000 (11:42 +0000)]
Make expand_location resolve to locus in main source file
Apparently, quite some places in the compiler (like the C/C++
preprocessor, the debug info machinery) expect expand_location to
resolve to locations that are in the main source file, even if the
token at stake comes from a macro that was defined in a header
somewhere. Turning on -ftrack-macro-expansion by default was
triggering a lot of failures (not necessarily related to diagnostics)
because expand_location resolves to spelling locations instead.
So I have changed expand_location to honour the initial expectation.
In addition, I came up with the new expand_location_to_spelling_point
used in diagnostic_build_prefix because the diagnostic system, on the
other hand, wants to point to the location of the token where it was
spelled, and then display the error context involving all the macro
whose expansion led to that spelling point - if we are in the context
of a macro expansion there.
This seems to me like a reasonable balance.
Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk and
whitnessed that a lot more tests were PASSing.
Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches. This patch
just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
gcc/
* input.c (expand_location_1): New. Takes a parameter to choose
whether to resolve the location to spelling or expansion point.
Was factorized from ...
(expand_location): ... here.
(expand_location_to_spelling_point): New. Implemented in terms of
expand_location_1.
* diagnostic.c (diagnostic_build_prefix): Use the new
expand_location_to_spelling_point instead of expand_location.
From-SVN: r186969
Dodji Seketeli [Mon, 30 Apr 2012 11:41:46 +0000 (11:41 +0000)]
Fix expansion point loc for macro-like tokens
Consider the test case gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c.
Its interesting part is:
#define A(x) vari x /* line 7. */
#define vari(x)
#define B , varj
int A(B) ; /* line 10. */
In its initial version, this test was being pre-processed as:
# 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
# 1 "build/gcc//"
# 1 "<command-line>"
# 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
# 10 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
int
# 7 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
vari
, varj ;
Note how "int" and "vari" are on separate lines, whereas "int" and
", varj" are on the same line.
This looks like a bug to me, even independantly from the macro
location tracking work.
With macro location tracking turned on, the preprocessed output
becomes:
# 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
# 1 "<command-line>"
# 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
# 10 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c"
int vari , varj ;
Which, IMO, is what we'd expect.
This is due to an unexpected side effect of enter_macro_context when
passed a token that might look like a function-like macro at first
sight, but that it eventually considers to not be a macro after all.
This is the case for the "vari" token which looks like a macro when it
is first lexed, but is eventually considered to be a normal token by
enter_macro_context because it's not used as a function-like macro
invocation.
In that case, besides returning NULL, enter_macro_context sets
pfile->context->c.macro to NULL, making cpp_get_token_1 forget to set
the location of the "vari" to the expansion point of A.
enter_macro_context sets pfile->context->c.macro to NULL in that case
because funlike_invocation_p reads one token pass "foo", sees that
there is no '(' token, so we are not invoking the function-like
parameter. It then puts the tokens (which it has read after "foo")
back into the tokens stream by calling _cpp_push_token_context on it,
which sets pfile->context->c.macro to NULL, saying in essence that the
current macro expansion context is "stopped".
The fix here is to teach _cpp_push_token and
push_extended_tokens_context to continue the current macro context
when passed a NULL macro. But then, now that there can be several
continguous contexts associated with the same macro, we need to teach
_cpp_pop_context to re-enable the expansion of the current macro only
when we are really out of expanding the current macro. Otherwise we
can run in cases where we have recursive expansions of the same macro.
Tested on x86_64-unknown-linux-gnu against trunk. Now this test has
the same output with and without tracking locations accross macro
expansions.
Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches. This patch
just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
libcpp/
* macro.c (macro_of_context): New static function.
(_cpp_push_token_context, push_extended_tokens_context): If the
macro argument is NULL, it means we are continuing the expansion
of the current macro, if any. Update comments.
(_cpp_pop_context): Re-enable expansion of the macro only when we
are really out of the context of the current expansion.
gcc/testsuite/
* gcc.dg/debug/dwarf2/pr41445-5.c: Adjust.
* gcc.dg/debug/dwarf2/pr41445-6.c: Likewise.
From-SVN: r186968
Dodji Seketeli [Mon, 30 Apr 2012 11:41:34 +0000 (11:41 +0000)]
Fix PCH crash on GTYed pointer-to-scalar field of a struct
When -ftrack-macro-expansion is activated, the PCH generation
machinery can crash in gt_pch_save when it's about to relocate the
pointer for the
line_maps::info_macro::maps[i]::d.macro.macro_locations member.
The call that crashes (in ggc-common.c) is:
state.ptrs[i]->note_ptr_fn (state.ptrs[i]->obj,
state.ptrs[i]->note_ptr_cookie,
relocate_ptrs, &state);
The ->note_ptr_fn called in this case is the gengtype-generated
gt_pch_p_9line_maps function. It crashes because the second argument
passed to it is a pointer to struct line_map, instead of being a
pointer to struct line_maps (extra 's') like what the function
expects.
You can see the crash for the test case:
runtest --tool g++ --tool_opts="-ftrack-macro-expansion" pch.exp=system-1.C
I believe it's because a part of the code of gt_pch_nx_line_maps
(generated as part of gtype-desc.c by gengtype) is not correct. Note
that this gt_pch_nx_line_maps function is called from gt_pch_save in
the snippet:
for (rt = gt_ggc_rtab; *rt; rt++)
for (rti = *rt; rti->base != NULL; rti++)
for (i = 0; i < rti->nelt; i++)
(*rti->pchw)(*(void **)((char *)rti->base + rti->stride * i));
So, in that gt_pch_nx_line_maps, in the branch that starts with the
code:
if ((*x).info_macro.maps != NULL) {
size_t i3;
for (i3 = 0; i3 != (size_t)(((*x).info_macro).used); i3++) {
switch (((*x).info_macro.maps[i3]).reason == LC_ENTER_MACRO)
we have the code:
gt_pch_note_object ((*x).info_macro.maps[i3].d.macro.macro_locations,
(*x).info_macro.maps,
gt_pch_p_9line_maps,
gt_types_enum_last);
This last snippet registers gt_pch_p_9line_maps to be called on the
object pointed by (*x).info_macro.maps[i3].d.macro.macro_locations (as
a first argument), with (*x).info_macro.maps as its second argument.
Note that (*x).info_macro.maps is of type struct line_map*, while 'x'
is of type struct line_maps* - beware, there is an 's' at the end of
the latter.
The problem is that gt_pch_p_9line_maps requires that its second
argument be an instance of _struct line_maps_, not struct line_map.
So later when gt_pch_p_9line_maps is called, it just crashes.
More generally, these gt_pch_p_xxx functions seem to require that
their second argument be an instance of the xxx in question. And that
invariant is violated by the snippet of code above.
The invariant seems to be violated only for the case where a GTYed
structure (possibly embedded in another GTYed structure) contains a
pointer to a scalar (that is not a string) which memory is ggc/GTY
managed, like the line_map_macro::macro_locations field. And this
only happens for PCH generation.
Looking at gengtype.c, it seems like write_types_process_field can be
fooled in that case. It expects that the expression d->prev_val[3]
contains the name of the second argument of the gt_pch_p_xxx (which is
generically referenced by wtd->subfield_marker_routine there). That
expression can resolve to either "x", as we would like it to be, but
can also resolve to another arbitrary name for e.g, the case of a
pointer-to-struct used as a root).
This patch simply forces the second argument of gt_pch_p_xxx to be 'x'
even in the case of a member that is a pointer to a scalar.
As a result, here is the the diff the new generated gtype-desc.c file:
@@ -5234,7 +5234,7 @@ gt_pch_nx_line_maps (void *x_p)
size_t i2;
for (i2 = 0; i2 != (size_t)(2 * ((*x).info_ordinary.maps[i0].d.macro).n_tokens); i2++) {
}
- gt_pch_note_object ((*x).info_ordinary.maps[i0].d.macro.macro_locations, (*x).info_ordinary.maps, gt_pch_p_9line_maps, gt_types_enum_last);
+ gt_pch_note_object ((*x).info_ordinary.maps[i0].d.macro.macro_locations, x, gt_pch_p_9line_maps, gt_types_enum_last);
}
break;
default:
@@ -5261,7 +5261,7 @@ gt_pch_nx_line_maps (void *x_p)
size_t i5;
for (i5 = 0; i5 != (size_t)(2 * ((*x).info_macro.maps[i3].d.macro).n_tokens); i5++) {
}
- gt_pch_note_object ((*x).info_macro.maps[i3].d.macro.macro_locations, (*x).info_macro.maps, gt_pch_p_9line_maps, gt_types_enum_last);
+ gt_pch_note_object ((*x).info_macro.maps[i3].d.macro.macro_locations, x, gt_pch_p_9line_maps, gt_types_enum_last);
}
break;
default:
@@ -9366,7 +9366,7 @@ gt_pch_na_regno_reg_rtx (ATTRIBUTE_UNUSED void *x_p)
for (i1 = 0; i1 != (size_t)(crtl->emit.x_reg_rtx_no); i1++) {
gt_pch_n_7rtx_def (regno_reg_rtx[i1]);
}
- gt_pch_note_object (regno_reg_rtx, ®no_reg_rtx, gt_pch_pa_regno_reg_rtx, gt_types_enum_last);
+ gt_pch_note_object (regno_reg_rtx, x, gt_pch_pa_regno_reg_rtx, gt_types_enum_last);
}
}
I think it's pretty much what I was willing to have.
Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
Note that the bootstrap with -ftrack-macro-expansion exhibits
other separate issues that are addressed in subsequent patches.
This patch just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned
off, though.
gcc/
* gengtype.c (write_types_process_field): Force second argument
of the call to the PCH object hierarchy walker to be 'x'.
From-SVN: r186967
Dodji Seketeli [Mon, 30 Apr 2012 11:41:21 +0000 (11:41 +0000)]
Fix token pasting with -ftrack-macro-expansion
This patch makes token pasting work with -ftrack-macro-expansion
turned on. It improves some pasting related tests of the gcc.dg/cpp
subdirectory.
Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.
Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches. This patch
just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
libcpp/
* macro.c (paste_all_tokens): Put the token resulting from pasting
into an extended token context with -ftrack-macro-location is in
effect.
gcc/testsuite/
* gcc.dg/cpp/paste17.c: New test case for
-ftrack-macro-expansion=2 mode only.
* gcc.dg/cpp/macro-exp-tracking-5.c: Likewise.
From-SVN: r186966
Dodji Seketeli [Mon, 30 Apr 2012 11:41:08 +0000 (11:41 +0000)]
Fix cpp_sys_macro_p with -ftrack-macro-expansion
cpp_sys_macro_p crashes when -ftrack-macro-expansion is on. The issue
can be reproduced by running the tests:
runtest --tool gcc --tool_opts="-ftrack-macro-expansion" cpp.exp=sysmac1.c
runtest --tool gcc --tool_opts="-ftrack-macro-expansion" cpp.exp=sysmac2.c
This is because it just doesn't support that mode. Fixed thus.
Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.
Note that the bootstrap with -ftrack-macro-expansion turned on
exhibits other separate issues that are addressed in subsequent
patches. This patch just fixes one class of problems.
The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.
libcpp/
* macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
From-SVN: r186965
Eric Botcazou [Mon, 30 Apr 2012 08:31:29 +0000 (08:31 +0000)]
decl.c (gnat_to_gnu_entity): In type annotation mode...
* gcc-interface/decl.c (gnat_to_gnu_entity): In type annotation mode,
do not adjust the size of a tagged type if there is a representation
clause on it. Otherwise, round the adjustment up to the alignment
of the first field and use the appropriate helper routine.
(maybe_pad_type): Do not warn in type annotation mode on a tagged type.
(gnat_to_gnu_field): Do not error out under the same circumstances.
(annotate_rep): In type annotation mode, do not adjust the offset of
components of a tagged type with representation clause. Otherwise,
round the adjustment up to the alignment of the first field.
From-SVN: r186961
Eric Botcazou [Mon, 30 Apr 2012 08:11:42 +0000 (08:11 +0000)]
i386.c (ix86_handle_struct_attribute): Use the proper predicate to discriminate types.
* config/i386/i386.c (ix86_handle_struct_attribute): Use the proper
predicate to discriminate types.
ada/
* gcc-interface/utils.c (finish_record_type): Force the traditional GCC
layout for bitfields on the type if it is packed or has a representation
clause and an alternate layout is available.
From-SVN: r186958
Manuel López-Ibáñez [Mon, 30 Apr 2012 08:02:53 +0000 (08:02 +0000)]
c-common.c (check_function_arguments): Replace Wmissing-format-attribute with Wsuggest-attribute=format.
2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-common.c (check_function_arguments): Replace
Wmissing-format-attribute with Wsuggest-attribute=format.
From-SVN: r186957
Eric Botcazou [Mon, 30 Apr 2012 07:50:07 +0000 (07:50 +0000)]
gigi.h (mark_out_of_scope): Delete.
* gcc-interface/gigi.h (mark_out_of_scope): Delete.
(destroy_gnat_to_gnu): Declare.
(destroy_dummy_type): Likewise.
* gcc-interface/decl.c (mark_out_of_scope): Delete.
* gcc-interface/utils.c (destroy_gnat_to_gnu): New function.
(destroy_dummy_type): Likewise.
* gcc-interface/trans.c (gnat_validate_uc_list): New variable.
(gigi): Call validate_unchecked_conversion on gnat_validate_uc_list
after the translation is completed. Call destroy_gnat_to_gnu and
destroy_dummy_type at the end.
(Subprogram_Body_to_gnu): Do not call mark_out_of_scope.
(gnat_to_gnu) <N_Block_Statement>: Likewise.
<N_Validate_Unchecked_Conversion>: Do not process the node, only push
it onto gnat_validate_uc_list.
(validate_unchecked_conversion): New function.
From-SVN: r186956
Manuel López-Ibáñez [Mon, 30 Apr 2012 07:42:42 +0000 (07:42 +0000)]
invoke.texi (Wmissing-format-attribute): Document as an alias of Wsuggest-attribute=format.
2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
gcc/
* doc/invoke.texi (Wmissing-format-attribute): Document as an
alias of Wsuggest-attribute=format.
c-family/
* c.opt (Wsuggest-attribute=format): New. Alias of
Wmissing-format-attribute.
* c-format.c (decode_format_type): Replace
Wmissing-format-attribute with Wsuggest-attribute=format.
(check_function_format): Likewise.
cp/
* typeck.c (convert_for_assignment): Replace
Wmissing-format-attribute with Wsuggest-attribute=format.
* call.c (convert_for_arg_passing): Likewise.
gcc/
* c-typeck.c (convert_for_assignment): Replace
Wmissing-format-attribute with Wsuggest-attribute=format.
(digest_init): Likewise.
From-SVN: r186955
GCC Administrator [Mon, 30 Apr 2012 00:18:41 +0000 (00:18 +0000)]
Daily bump.
From-SVN: r186952
Marc Glisse [Sun, 29 Apr 2012 23:36:09 +0000 (01:36 +0200)]
re PR libstdc++/51795 (linear_congruential_engine doesn't work correctly)
2012-04-29 Marc Glisse <marc.glisse@inria.fr>
Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/51795
* include/bits/stl_algobase.h (__lg<>(_Size)): Remove.
(__lg(int), __lg(unsigned), __lg(long), __lg(unsigned long),
__lg(long long), __lg(unsigned long long)): Define constexpr.
* include/bits/random.h (_Mod<>): Overcome Schrage's algorithm
limitations.
(__mod): Adjust.
(linear_congruential): Remove FIXME static_assert.
* include/bits/random.tcc (_Mod<>): Adjust.
* testsuite/26_numerics/random/linear_congruential_engine/operators/
51795.cc: New.
Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r186948
Jonathan Wakely [Sun, 29 Apr 2012 22:59:37 +0000 (22:59 +0000)]
functional (function::function(F)): LWG 2132: Disable constructor if argument isn't callable.
* include/std/functional (function::function(F)): LWG 2132: Disable
constructor if argument isn't callable.
* testsuite/20_util/function/cons/callable.cc: New.
From-SVN: r186947
Dodji Seketeli [Sun, 29 Apr 2012 16:27:08 +0000 (16:27 +0000)]
Don't use C++ style comments in libcpp
I noticed that the file lex.c had C++ style comments, which I believe
is against the coding standards of the project.
Fixed, tested and applied to master as per the obvious rule.
libcpp/
* lex.c (lex_raw_string): Change C++ style comments into C
style comments.
(lex_string): Likewise.
From-SVN: r186946
Manuel López-Ibáñez [Sun, 29 Apr 2012 09:47:43 +0000 (09:47 +0000)]
re PR regression/53149 (gcc.dg/
20011021-1.c)
2012-04-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 53149
* gcc.dg/
20011021-1.c: Adjust testcase.
From-SVN: r186945
Marc Glisse [Sun, 29 Apr 2012 09:25:17 +0000 (09:25 +0000)]
re PR libstdc++/22200 (numeric_limits<signed>::is_modulo is inconsistent with gcc)
2012-04-29 Marc Glisse <marc.glisse@inria.fr>
PR libstdc++/22200
* include/std/limits (numeric_limits<>::is_modulo): False for
signed types.
From-SVN: r186944
Manuel López-Ibáñez [Sun, 29 Apr 2012 09:15:30 +0000 (09:15 +0000)]
opts.c (finish_options): Do not handle -Wmissing-noreturn here.
2012-04-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
* opts.c (finish_options): Do not handle -Wmissing-noreturn here.
* common.opt (Wmissing-noreturn): Alias of -Wsuggest-attribute=noreturn.
From-SVN: r186943
Thomas Koenig [Sun, 29 Apr 2012 07:12:03 +0000 (07:12 +0000)]
re PR fortran/53148 (Incorrect intrinsic function parsing on labeled statements when compiled w/ -ffrontend-optimize)
2012-04-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/53148
* frontend-passes.c (create_var): If the statement has a label,
put the label around the block.
2012-04-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/53148
* gfortran.dg/function_optimize_12.f90: New test.
From-SVN: r186942
Hans-Peter Nilsson [Sun, 29 Apr 2012 07:00:01 +0000 (07:00 +0000)]
re PR target/53156 (gcc.target/cris/peep2-andu2.c)
PR target/53156
* gcc.target/cris/peep2-andu2.c: Tweak expected assembly
code to match current output and cover new peephole2 pattern.
From-SVN: r186941
Hans-Peter Nilsson [Sun, 29 Apr 2012 06:59:09 +0000 (06:59 +0000)]
re PR target/53156 (gcc.target/cris/peep2-andu2.c)
PR target/53156
* config/cris/cris.md (andqu): New peephole2.
(andu): Tweak head comment.
From-SVN: r186940
GCC Administrator [Sun, 29 Apr 2012 00:18:47 +0000 (00:18 +0000)]
Daily bump.
From-SVN: r186938
Doug Evans [Sat, 28 Apr 2012 21:37:19 +0000 (21:37 +0000)]
* dwarf2.def (DW_OP): Add DW_OP_GNU_addr_index.
From-SVN: r186934
Aurelien Jarno [Sat, 28 Apr 2012 08:03:54 +0000 (08:03 +0000)]
config.host (mips64*-*-linux*, [...]): Remove.
libgcc/
2012-04-28 Aurelien Jarno <aurelien@aurel32.net>
* config.host (mips64*-*-linux*, mipsisa64*-*-linux*): Remove.
(mips*-*-linux*): Include mips/t-tpbit when long double is
16 bytes long.
From-SVN: r186931
Ian Lance Taylor [Sat, 28 Apr 2012 04:56:55 +0000 (04:56 +0000)]
compiler: Fix some crashes on invalid code.
Fixes issue 7.
From-SVN: r186929
Joern Rennecke [Sat, 28 Apr 2012 01:56:54 +0000 (01:56 +0000)]
re PR tree-optimization/38785 (huge performance regression on EEMBC bitmnp01)
PR tree-optimization/38785
* common.opt (ftree-partial-pre): New option.
* doc/invoke.texi: Document it.
* opts.c (default_options_table): Initialize flag_tree_partial_pre.
* tree-ssa-pre.c (do_partial_partial_insertion): Insert only if it will
benefit speed path.
(execute_pre): Use flag_tree_partial_pre.
Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>
Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org>
From-SVN: r186928
Ian Lance Taylor [Sat, 28 Apr 2012 00:29:23 +0000 (00:29 +0000)]
compiler: Use less memory for array/slice literals.
Fixes issue 8 in gofrontend issues list.
From-SVN: r186926
GCC Administrator [Sat, 28 Apr 2012 00:18:20 +0000 (00:18 +0000)]
Daily bump.
From-SVN: r186925
John David Anglin [Fri, 27 Apr 2012 20:41:16 +0000 (20:41 +0000)]
re PR target/52999 (ICE, segmentation fault in c_tree_printer)
PR target/52999
* config/pa/pa.c (pa_legitimate_constant_p): Don't put function labels
in constant pool.
From-SVN: r186919
Tom Tromey [Fri, 27 Apr 2012 16:58:53 +0000 (16:58 +0000)]
* dwarf2.h: Wrap function declarations in extern "C".
From-SVN: r186918
Ian Lance Taylor [Fri, 27 Apr 2012 16:38:11 +0000 (16:38 +0000)]
re PR go/52358 (math FAILs on Solaris 8 and 9)
PR go/52358
configure, runtime: Provide i386 long double math functions if needed.
From-SVN: r186915
Ian Lance Taylor [Fri, 27 Apr 2012 16:32:42 +0000 (16:32 +0000)]
re PR go/52358 (math FAILs on Solaris 8 and 9)
PR go/52358
math: Work around bug in Solaris 9 implementation of ldexp.
The bug is that ldexp(-1, -1075) should return -0, but the
Solaris 9 implementation returns +0.
From-SVN: r186913
Ian Lance Taylor [Fri, 27 Apr 2012 16:28:21 +0000 (16:28 +0000)]
runtime: Correct syscall.Setenv for systems that don't have setenv.
From-SVN: r186911
Ollie Wild [Fri, 27 Apr 2012 14:29:32 +0000 (14:29 +0000)]
Add new option, -Wliteral-suffix.
This option, which is enabled by default, causes the preprocessor to warn
when a string or character literal is followed by a ud-suffix which does
not begin with an underscore. According to [lex.ext]p10, this is
ill-formed.
Also modifies the preprocessor to treat such ill-formed suffixes as separate
preprocessing tokens. This is consistent with the Clang front end (see
http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and enables
backwards compatibility with code that uses formatting macros from
<inttypes.h>, as in the following code block:
int main() {
int64_t i64 = 123;
printf("My int64: %"PRId64"\n", i64);
}
Google ref b/
6377711.
2012-04-27 Ollie Wild <aaw@google.com>
PR c++/52538
* gcc/c-family/c-common.c: Add CPP_W_LITERAL_SUFFIX mapping.
* gcc/c-family/c-opts.c (c_common_handle_option): Handle
OPT_Wliteral_suffix.
* gcc/c-family/c.opt: Add Wliteral-suffix.
* gcc/doc/invoke.texi (Wliteral-suffix): Document new option.
* gcc/testsuite/g++.dg/cpp0x/Wliteral-suffix.c: New test.
* libcpp/include/cpplib.h (struct cpp_options): Add new field,
warn_literal_suffix.
(CPP_W_LITERAL_SUFFIX): New enum.
* libcpp/init.c (cpp_create_reader): Default initialization of
warn_literal_suffix.
* libcpp/lex.c (lex_raw_string): Treat user-defined literals which
don't begin with '_' as separate tokens and produce a warning.
(lex_string): Ditto.
From-SVN: r186909
Tom Tromey [Fri, 27 Apr 2012 14:14:14 +0000 (14:14 +0000)]
dwarf2out.c (dwarf_stack_op_name): Use get_DW_OP_name.
gcc
* dwarf2out.c (dwarf_stack_op_name): Use get_DW_OP_name.
(dwarf_tag_name): Use get_DW_TAG_name.
(dwarf_attr_name): Use get_DW_AT_name.
(dwarf_form_name): Use get_DW_FORM_name.
* dwarf2cfi.c (dwarf_cfi_name): Use get_DW_CFA_name.
include
* dwarf2.h (enum dwarf_tag, enum dwarf_form, enum dwarf_attribute)
(enum dwarf_location_atom, enum dwarf_type, enum
dwarf_call_frame_info): Remove.
(DW_TAG, DW_TAG_DUP, DW_FORM, DW_AT, DW_AT_DUP, DW_OP)
(DW_OP_DUP, DW_ATE, DW_ATE_DUP, DW_CFA): New macros.
Include dwarf2.def.
(get_DW_TAG_name, get_DW_AT_name, get_DW_FORM_name)
(get_DW_OP_name, get_DW_ATE_name): Declare.
* dwarf2.def: New file, from dwarf2.h.
libiberty
* dwarfnames.c: New file.
* Makefile.in (CFILES): Add dwarfnames.
(REQUIRED_OFILES): Add dwarfnames.
(./dwarfnames.$(objext)): New target.
From-SVN: r186908
Paolo Bonzini [Fri, 27 Apr 2012 12:20:01 +0000 (12:20 +0000)]
tree-ssa-phiopt.c (conditional_replacement): Replace PHIs whose arguments are -1 and 0...
2012-04-27 Paolo Bonzini <bonzini@gnu.org>
* tree-ssa-phiopt.c (conditional_replacement): Replace PHIs
whose arguments are -1 and 0, by negating the result of the
conditional.
testsuite:
2012-04-27 Paolo Bonzini <bonzini@gnu.org>
* gcc.c-torture/execute/
20120427-2.c: New testcase.
* gcc.dg/tree-ssa/phi-opt-10.c: New testcase.
* gcc.dg/tree-ssa/ssa-pre-28.c: Bypass new optimization.
* gcc.dg/tree-ssa/ssa-ifcombine-7.c: Look into ifcombine dump.
From-SVN: r186905
Paolo Bonzini [Fri, 27 Apr 2012 12:17:50 +0000 (12:17 +0000)]
re PR target/53138 (spaceship operator miscompiled)
2012-04-27 Paolo Bonzini <bonzini@gnu.org>
PR target/53138
* config/i386/i386.md (x86_mov<mode>cc_0_m1_neg): Add clobber.
testsuite:
2012-04-27 Paolo Bonzini <bonzini@gnu.org>
PR target/53138
* gcc.c-torture/execute/
20120427-1.c: New testcase.
From-SVN: r186904
Richard Guenther [Fri, 27 Apr 2012 11:58:20 +0000 (11:58 +0000)]
tree-flow.h (is_hidden_global_store): Remove.
2012-04-27 Richard Guenther <rguenther@suse.de>
* tree-flow.h (is_hidden_global_store): Remove.
* tree-ssa-sink.c (is_hidden_global_store): Likewise.
* tree-ssa-alias.h (ref_may_alias_global_p): Declare.
(stmt_may_clobber_global_p): Likewise.
* tree-ssa-alias.c (ref_may_alias_global_p): New function.
(stmt_may_clobber_global_p): Likewise.
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Call
stmt_may_clobber_global_p.
* tree-ssa-dse.c (dse_possible_dead_store_p): Likewise.
From-SVN: r186903
Steven Bosscher [Fri, 27 Apr 2012 11:12:52 +0000 (11:12 +0000)]
cfg.c (disconnect_src): Do df_mark_solutions_dirty in the right place.
* cfg.c (disconnect_src): Do df_mark_solutions_dirty in the right
place.
From-SVN: r186902
Steven Bosscher [Fri, 27 Apr 2012 11:11:45 +0000 (11:11 +0000)]
tree-switch-conversion.c (struct switch_conv_info): Add range_max, reorganize some fields and update comments.
gcc/
* tree-switch-conversion.c (struct switch_conv_info): Add range_max,
reorganize some fields and update comments. Rename bit_test_uniq
and bit_test_count to uniq resp. count. Remove bit_test_bb.
(collect_switch_conv_info): New function, collects info about a
GIMPLE_SWITCH into a struct switch_conv_info.
(check_range): Simplify to use pre-recorded info. Fix think-o in
range-branch ratio check.
(check_process_case): Remove function.
(check_all_empty_except_final): New function, verifies that all
non-final basic blocks are empty.
(process_switch): Simplify to use pre-recorded info. Call
collect_switch_conv_info to do that. Assert that degenerate switch
statements have been cleaned up.
From-SVN: r186901
Marc Glisse [Fri, 27 Apr 2012 10:34:13 +0000 (12:34 +0200)]
re PR middle-end/27139 (Optimize double INT->FP->INT conversions with -ffast-math)
2012-04-27 Marc Glisse <marc.glisse@inria.fr>
PR middle-end/27139
* tree-ssa-forwprop.c (combine_conversions): Handle INT->FP->INT.
* gcc.dg/tree-ssa/forwprop-18.c: New test.
From-SVN: r186898
Manuel López-Ibáñez [Fri, 27 Apr 2012 08:21:49 +0000 (08:21 +0000)]
re PR regression/53130 (gcc.dg/
20011021-1.c, gcc.dg/m-un-2.c, gcc.dg/missing-field-init-2.c)
2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53130
* c-typeck.c (pop_init_level): Use %qD instead of %qT.
From-SVN: r186896
Tom de Vries [Fri, 27 Apr 2012 06:28:49 +0000 (06:28 +0000)]
re PR tree-optimization/51879 (Missed tail merging with non-const/pure calls)
2012-04-27 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/51879
* gcc.dg/pr51879.c: New test.
* gcc.dg/pr51879-2.c: Same.
* gcc.dg/pr51879-3.c: Same.
* gcc.dg/pr51879-4.c: Same.
* gcc.dg/pr51879-6.c: Same.
From-SVN: r186895
Tom de Vries [Fri, 27 Apr 2012 06:12:49 +0000 (06:12 +0000)]
re PR tree-optimization/51879 (Missed tail merging with non-const/pure calls)
2012-04-27 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/51879
* tree-ssa-sccvn.h (struct vn_reference_s): Add result_vdef field.
* tree-ssa-sccvn.c (mark_use_processed): New function, factored out
of ...
(defs_to_varying): ... here. Don't set use_processed.
(visit_reference_op_call): Handle gimple_vdef.
Handle case that lhs is NULL_TREE.
(visit_use): Use mark_use_processed. Handle calls with side-effect
using visit_reference_op_call.
From-SVN: r186894
GCC Administrator [Fri, 27 Apr 2012 00:18:06 +0000 (00:18 +0000)]
Daily bump.
From-SVN: r186892
Paolo Carlini [Thu, 26 Apr 2012 23:32:14 +0000 (23:32 +0000)]
re PR c++/53096 ([DR 1333] [c++11] should be possible to default a copy ctor that takes non-const arg)
/cp
2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53096
* class.c (check_bases_and_members): Implement core/1333, do not
disallow defaulted in the class body non-const ref special members.
/testsuite
2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53096
* g++.dg/cpp0x/defaulted35.C: New.
* g++.dg/cpp0x/defaulted15.C: Adjust.
From-SVN: r186888
Richard Sandiford [Thu, 26 Apr 2012 15:49:44 +0000 (15:49 +0000)]
sched-deps.c (fixup_sched_groups): Rename to...
gcc/
* sched-deps.c (fixup_sched_groups): Rename to...
(chain_to_prev_insn): ...this.
(chain_to_prev_insn_p): New function.
(deps_analyze_insn): Use it instead of SCHED_GROUP_P.
From-SVN: r186883
Richard Sandiford [Thu, 26 Apr 2012 15:49:30 +0000 (15:49 +0000)]
sched-int.h (_haifa_insn_data): Move priority_status.
gcc/
* sched-int.h (_haifa_insn_data): Move priority_status.
Add model_index.
(INSN_MODEL_INDEX): New macro.
* haifa-sched.c (insn_delay): New function.
(sched_regno_pressure_class): Update commentary.
(mark_regno_birth_or_death): Pass the liveness bitmap and
pressure array as arguments, instead of using curr_reg_live and
curr_reg_pressure. Only update the pressure if the bit in the
liveness set has changed.
(initiate_reg_pressure_info): Always trust the live-in set for
SCHED_PRESSURE_MODEL.
(initiate_bb_reg_pressure_info): Update call to
mark_regno_birth_or_death.
(dep_list_size): Take the list as argument.
(calculate_reg_deaths): New function, extracted from...
(setup_insn_reg_pressure_info): ...here.
(MODEL_BAR): New macro.
(model_pressure_data, model_insn_info, model_pressure_limit)
(model_pressure_group): New structures.
(model_schedule, model_worklist, model_insns, model_num_insns)
(model_curr_point, model_before_pressure, model_next_priority):
New variables.
(MODEL_PRESSURE_DATA, MODEL_MAX_PRESSURE, MODEL_REF_PRESSURE)
(MODEL_INSN_INFO, MODEL_INSN): New macros.
(model_index, model_update_limit_points_in_group): New functions.
(model_update_limit_points, model_last_use_except): Likewise.
(model_start_update_pressure, model_update_pressure): Likewise.
(model_recompute, model_spill_cost, model_excess_group_cost): Likewise.
(model_excess_cost, model_dump_pressure_points): Likewise.
(model_set_excess_costs): Likewise.
(rank_for_schedule): Extend SCHED_PRIORITY_WEIGHTED ordering to
SCHED_PRIORITY_MODEL. Use insn_delay. Use the order in the model
schedule as an alternative tie-breaker. Update the call to
dep_list_size.
(ready_sort): Call model_set_excess_costs.
(update_register_pressure): Update call to mark_regno_birth_or_death.
Rely on that function to check liveness rather than doing it here.
(model_classify_pressure, model_order_p, model_add_to_worklist_at)
(model_remove_from_worklist, model_add_to_worklist, model_promote_insn)
(model_add_to_schedule, model_analyze_insns, model_init_pressure_group)
(model_record_pressure, model_record_pressures): New functions.
(model_record_final_pressures, model_add_successors_to_worklist)
(model_promote_predecessors, model_choose_insn): Likewise.
(model_reset_queue_indices, model_dump_pressure_summary): Likewise.
(model_start_schedule, model_finalize_pressure_group): Likewise.
(model_end_schedule): Likewise.
(schedule_insn): Say when we're scheduling the next instruction
in the model schedule.
(schedule_insn): Handle SCHED_PRESSURE_MODEL.
(queue_to_ready): Do not add instructions that are
MAX_SCHED_READY_INSNS beyond the current point of the model schedule.
Always allow the next instruction in the model schedule to be added.
(debug_ready_list): Print the INSN_REG_PRESSURE_EXCESS_COST_CHANGE
and delay for SCHED_PRESSURE_MODEL too.
(prune_ready_list): Extend SCHED_PRIORITY_WEIGHTED handling to
SCHED_PRIORITY_MODEL, but also take the DFA into account.
(schedule_block): Call model_start_schedule and model_end_schedule.
Extend SCHED_PRIORITY_WEIGHTED stall handling to SCHED_PRIORITY_MODEL.
(sched_init): Extend INSN_REG_PRESSURE_EXCESS_COST_CHANGE handling
to SCHED_PRESSURE_MODEL, but don't allocate saved_reg_live or
region_ref_regs.
(sched_finish): Update accordingly.
(fix_tick_ready): Extend INSN_REG_PRESSURE_EXCESS_COST_CHANGE handling
to SCHED_PRESSURE_MODEL.
(add_jump_dependencies): Update call to dep_list_size.
(haifa_finish_h_i_d): Fix leak of max_reg_pressure.
(haifa_init_insn): Extend INSN_REG_PRESSURE_EXCESS_COST_CHANGE handling
to SCHED_PRESSURE_MODEL.
* sched-deps.c (init_insn_reg_pressure_info): Likewise, but don't
allocate INSN_MAX_REG_PRESSURE for SCHED_PRESSURE_MODEL.
(sched_analyze_insn): Extend INSN_REG_PRESSURE_EXCESS_COST_CHANGE
handling to SCHED_PRESSURE_MODEL.
From-SVN: r186882
Richard Sandiford [Thu, 26 Apr 2012 15:49:13 +0000 (15:49 +0000)]
common.opt (fsched-pressure-algorithm=): New option.
gcc/
* common.opt (fsched-pressure-algorithm=): New option.
* flag-types.h (sched_pressure_algorithm): New enum.
* sched-int.h (sched_pressure_p): Replace with...
(sched_pressure): ...this new variable.
* haifa-sched.c (sched_pressure_p): Replace with...
(sched_pressure): ...this new variable.
(sched_regno_pressure_class, rank_for_schedule, ready_sort)
(update_reg_and_insn_max_reg_pressure, schedule_insn)
(debug_ready_list, prune_ready_list, schedule_block, sched_init)
(sched_finish, fix_tick_ready, haifa_init_insn): Update accordingly.
* sched-deps.c (init_insn_reg_pressure_info): Likewise.
(sched_analyze_insn): Likewise.
* sched-rgn.c (schedule_region): Likewise.
* config/m68k/m68k.c (m68k_sched_variable_issue): Likewise.
From-SVN: r186881
Janis Johnson [Thu, 26 Apr 2012 15:16:16 +0000 (15:16 +0000)]
bf-ms-layout.c: Adjust offsets to fit ms-bitfield structure layout.
* gcc.dg/bf-ms-layout.c: Adjust offsets to fit ms-bitfield
structure layout.
From-SVN: r186880
Bernd Schmidt [Thu, 26 Apr 2012 14:20:39 +0000 (14:20 +0000)]
re PR middle-end/52940 (conversion from MODE_PARTIAL_INT uses sign extension for unsigned types)
PR middle-end/52940
* machmode.h (CLASS_HAS_WIDER_MODES_P): True for MODE_PARTIAL_INT.
* expr.c (convert_move): Honor unsignedp when extending partial int
modes.
* genmodes.c (complete_mode): Don't clear component field of partial
int modes.
(emit_mode_inner): Don't emit it however.
(calc_wider_mode): Partial int modes widen to their component.
From-SVN: r186877
Bernd Schmidt [Thu, 26 Apr 2012 13:25:41 +0000 (13:25 +0000)]
re PR middle-end/52997 (FAIL: gcc.dg/c99-intconst-1.c (internal compiler error))
* PR middle-end/52997
* ira.c (find_moveable_pseudos): Call resize_reg_info.
From-SVN: r186875
Arnaud Charlet [Thu, 26 Apr 2012 10:49:44 +0000 (12:49 +0200)]
[multiple changes]
2012-04-26 Tristan Gingold <gingold@adacore.com>
* gcc-interface/Make-lang.in: Update dependencies.
Remove s-traceb and tracebak objects from gnat1 and gnatbind (not used).
Remove s-tasdeb and s-vaflop rules (not used).
2012-04-26 Olivier Hainque <hainque@adacore.com>
* gcc-interface/targtyps.c (WIDEST_HARDWARE_FP_SIZE): Default to
DOUBLE_TYPE_SIZE instead of LONG_DOUBLE_TYPE_SIZE.
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* a-calend.adb (Day_Of_Week): Keep the internal
usage of UTC_Time_Offset consistent with Time_Of and Split.
From-SVN: r186872
Arnaud Charlet [Thu, 26 Apr 2012 10:03:51 +0000 (12:03 +0200)]
[multiple changes]
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Do not freeze
the loop variable while preanalyzing a quantified expression.
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* a-calend.adb (Split, Time_Of): Rename parameter Is_Ada_05
to Use_TZ to better illustrate its function. Update all
references to the parameter.
(To_Ada_Time): Update the call to Formatting_Operations.Time_Of.
* a-calend.ads (Split, Time_Of): Rename parameter Is_Ada_05
to Use_TZ to better illustrate its function. Update the related
comment on usage.
* a-calend-vms.adb (Split, Time_Of): Rename parameter
Is_Ada_05 to Use_TZ to better illustrate its function. Update
all references to the parameter.
(To_Ada_Time): Update the call to Formatting_Operations.Time_Of.
* a-calend-vms.ads (Split, Time_Of): Rename parameter Is_Ada_05
to Use_TZ to better illustrate its function. Update the related
comment on usage.
* a-calfor.adb (Split, Time_Of): Update the call to
Formatting_Operations.Time_Of.
* sysdep.c (__gnat_localtime_tzoff): Dereference pointer
"is_historic" and rewrite the check as a comparison. Add a
comment on flag values.
2012-04-26 Robert Dewar <dewar@adacore.com>
* exp_ch2.adb, sem_ch8.adb: Minor reformatting.
2012-04-26 Vasiliy Fofanov <fofanov@adacore.com>
* a-stzunb-shared.adb, gnat_ugn.texi, a-strunb-shared.adb,
a-strunb-shared.ads, uintp.adb, a-stwiun-shared.adb,
a-stwiun-shared.ads, a-cbhama.ads, vms_data.ads, a-cobove.adb,
a-convec.adb, sem_ch13.adb, a-cbhase.ads: Fix common misuses of the
word "then" where "than" should be used in English.
From-SVN: r186871
Arnaud Charlet [Thu, 26 Apr 2012 09:59:24 +0000 (11:59 +0200)]
[multiple changes]
2012-04-26 Robert Dewar <dewar@adacore.com>
* sem_ch5.adb (Check_Unreachable_Code): Skip past pragmas.
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* s-finroo.ads: Remove with clause for
Ada.Streams. Type Root_Controlled is now abstract tagged null
record. Remove internal package Stream_Attributes. Root_Controlled
doesn't need stream attribute redeclaration and avoids the
dependency on streams.
2012-04-26 Tristan Gingold <gingold@adacore.com>
* adaint.c (to_host_path_spec): Removed (unused).
Minor reformatting.
2012-04-26 Steve Baird <baird@adacore.com>
* gnat_rm.texi Improve description of Valid_Scalars attribute.
2012-04-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Can_Override_Operator): If the formal is a
generic type the operator cannot be overriding.
2012-04-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Spec_Reloaded_For_Body): Check whether the type
is declared in a package specification, and current unit is the
corresponding package body. The use clauses themselves may be
within a nested package.
2012-04-26 Bob Duff <duff@adacore.com>
* exp_ch2.adb (Param_Entity): Take into account the case where
the type of the entry parameter has a representation clause.
From-SVN: r186870
Arnaud Charlet [Thu, 26 Apr 2012 09:56:13 +0000 (11:56 +0200)]
[multiple changes]
2012-04-26 Ed Schonberg <schonberg@adacore.com>
* gnat_ugn.texi: Tweak dimensionality doc.
2012-04-26 Robert Dewar <dewar@adacore.com>
* sem_eval.adb: Minor reformatting.
From-SVN: r186869
Arnaud Charlet [Thu, 26 Apr 2012 09:52:02 +0000 (11:52 +0200)]
[multiple changes]
2012-04-26 Robert Dewar <dewar@adacore.com>
* einfo.adb, einfo.ads, sem_res.adb, sem_ch4.adb,
sem_eval.adb: Minor reformatting.
2012-04-26 Thomas Quinot <quinot@adacore.com>
* freeze.adb: Minor change in error wording.
2012-04-26 Ed Schonberg <schonberg@adacore.com>
* gnat_ugn.texi: Documentation on dimensional analysis.
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb, einfo.ads: Remove synthesized attribute
Proper_First_Index along with its associations in various nodes.
(Proper_First_Index): Removed.
* sem_ch4.adb (Analyze_Slice): Alphabetize constants. Add new
local variable Index_Type. The index type of a string literal
subtype is that of the stored low bound.
* sem_eval (Get_Static_Length): Remove the use of Proper_First_Index.
* sem_res.adb (Resolve_Slice): Alphabetize constants. Add
new local variable Index_Type. The index type of a
string literal subtype is that of the stored low bound.
(Set_String_Literal_Subtype): Code reformatting.
From-SVN: r186868
Arnaud Charlet [Thu, 26 Apr 2012 09:49:04 +0000 (11:49 +0200)]
[multiple changes]
2012-04-26 Robert Dewar <dewar@adacore.com>
* exp_aggr.adb: Minor reformatting.
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch7.adb (Expand_Cleanup_Actions): Update the call to
Requires_Cleanup_Actions.
* exp_util.adb (Requires_Cleanup_Actions (List_Id; Boolean;
Boolean)): Rename formal parameter For_Package to Lib_Level to
better reflect its purpose. Update the related comment and all
occurrences of For_Package in the body.
(Requires_Cleanup_Actions
(Node_Id; Boolean)): Add new formal parameter Lib_Level. Add
local constant At_Lib_Level to keep monitor whether the path
taken from the top-most context to the current construct involves
package constructs. Update all calls to Requires_Cleanup_Actions.
* exp_util.ads (Requires_Cleanup_Actions): Add new formal
parameter Lib_Level and associated comment.
2012-04-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Process_Formals): If the type of the formal is
a non null access type, mark the generated subtype as having a
delayed freeze only if the designated type is not frozen yet.
2012-04-26 Vincent Celier <celier@adacore.com>
* prj-attr.adb: New package Clean with attributes
Object_Artifact_Extensions and Source_Artifact_Extensions.
* prj-nmsc.adb (Process_Clean): Process new package Clean
* prj.ads (Language_Config): New components
Clean_Object_Artifacts and Clean_Source_Artifacts.
* snames.ads-tmpl: New standard names Clean,
Object_Artifact_Extensions and Source_Artifact_Extensions.
From-SVN: r186867
Arnaud Charlet [Thu, 26 Apr 2012 09:45:37 +0000 (11:45 +0200)]
[multiple changes]
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb (Proper_First_Index): Moved from Sem_Util.
* einfo.ads: Add new synthesized attribute Proper_First_Index
along with usage in nodes.
(Proper_First_Index): Moved from Sem_Util.
* sem_util.ads, sem_util.adb (Proper_First_Index): Moved to Einfo.
2012-04-26 Gary Dismukes <dismukes@adacore.com>
* layout.adb (Layout_Component_List): Test for the case of a
single variant and the size of its component list was computed
as an integer literal, and use that size (which is in bits)
as is rather than converting to storage units.
2012-04-26 Robert Dewar <dewar@adacore.com>
* exp_aggr.adb: Minor reformatting.
From-SVN: r186866
Arnaud Charlet [Thu, 26 Apr 2012 09:44:01 +0000 (11:44 +0200)]
[multiple changes]
2012-04-26 Robert Dewar <dewar@adacore.com>
* sem_util.adb: Minor reformatting.
2012-04-26 Thomas Quinot <quinot@adacore.com>
* exp_aggr.adb, exp_pakd.adb (Setup_Inline_Packed_Array_Reference,
Packed_Array_Aggregate_Handled.Get_Component_Val):
Reverse bit numbering within PAT when Reverse_Storage_Order
applies to the enclosing record.
2012-04-26 Thomas Quinot <quinot@adacore.com>
* freeze.adb (Freeze_Record_Type): Improve error message for
Scalar_Storage_Order inconsistent with Bit_Order.
From-SVN: r186865
David S. Miller [Thu, 26 Apr 2012 08:28:39 +0000 (08:28 +0000)]
Add sparc Niagara4 scheduling description and tweaks.
gcc/
* config/sparc/niagara4.md: New file.
* config/sparc/sparc.md: Include it.
* config/sparc/sparc.c (niagara4_costs): New processor costs.
(sparc_option_override): Use it.
(sparc_use_sched_lookahead): Return 2 for niagara4.
(sparc_issue_rate): Likewise.
From-SVN: r186864
David S. Miller [Thu, 26 Apr 2012 08:28:12 +0000 (08:28 +0000)]
Fix sparc instruction type settings and sched bugs.
gcc/
* config/sparc/sparc.md (attr type): Delete 'fgm_cmp'.
(fpack16_vis, fpackfix_vis, fpack32_vis): Set type to fgm_pack.
(fmul8x16_vis, fmul8x16au_vis, fmul8x16al_vis, fmul8sux16_vis,
fmul8ulx16_vis, fmuld8sux16_vis, fmuld8ulx16_vis): Set type to
fgm_mul.
(alignaddrsi_vis, alignaddrdi_vis, alignaddrlsi_vis,
alignaddrldi_vis): Set type to gsr.
(pdist_vis, pdistn<mode>_vis): Set type to fgm_pdsit.
(fcmp<code><GCM:gcm_name><P:mode>_vis, cmask8<P:mode>_vis,
cmask16<P:mode>_vis, cmask32<P:mode>_vis, fchksm16_vis,
v<vis3_shift_patname><mode>3, fmean16_vis,
fp<plusminus_insn>64_vis, <vis3_addsub_ss_patname><mode>3,
fucmp<code>8<P:mode>_vis): Set type to fga.
* config/sparc/ultra1_2.md: Remove refrences to fgm_cmp.
* config/sparc/niagara.md: Likewise.
* config/sparc/niagara2.md: Likewise.
* config/sparc/ultra3.md: Likewise, and fix type matching for
us3_ialuX reservation.
From-SVN: r186863
Andreas Krebbel [Thu, 26 Apr 2012 08:15:45 +0000 (08:15 +0000)]
reload.c (find_reloads): Change the loop nesting when trying an alternative with swapped operands.
2012-04-26 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* reload.c (find_reloads): Change the loop nesting when trying an
alternative with swapped operands.
From-SVN: r186861
Manuel López-Ibáñez [Thu, 26 Apr 2012 07:14:01 +0000 (07:14 +0000)]
tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Fix comment.
2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
* tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Fix
comment. Delete unused parameter first_exp_point_map.
(virt_loc_aware_diagnostic_finalizer): Update call.
libcpp/
* line-map.c (linemap_resolve_location): Synchronize comments with
those in line-map.h.
* include/line-map.h (linemap_resolve_location): Fix spelling in
comment.
From-SVN: r186860
Michael Hope [Thu, 26 Apr 2012 04:33:08 +0000 (04:33 +0000)]
linux-eabi.h (GLIBC_DYNAMIC_LINKER_SOFT_FLOAT): Define.
2012-04-26 Michael Hope <michael.hope@linaro.org>
Richard Earnshaw <rearnsha@arm.com>
* config/arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_SOFT_FLOAT): Define.
(GLIBC_DYNAMIC_LINKER_HARD_FLOAT): Define.
(GLIBC_DYNAMIC_LINKER_DEFAULT): Define.
(GLIBC_DYNAMIC_LINKER): Redefine to use the hard float path.
Co-Authored-By: Richard Earnshaw <rearnsha@arm.com>
From-SVN: r186859
Ian Lance Taylor [Thu, 26 Apr 2012 04:25:56 +0000 (04:25 +0000)]
mksysinfo, net: Always define syscall.SO_REUSEPORT.
From-SVN: r186857
Benjamin Kosnik [Thu, 26 Apr 2012 02:20:32 +0000 (02:20 +0000)]
hashtable.h: Adjust doxygen markup for base classes.
2012-04-25 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/hashtable.h: Adjust doxygen markup for base classes.
* include/bits/hashtable_policy.h: Same.
From-SVN: r186856
Sriraman Tallam [Thu, 26 Apr 2012 00:52:09 +0000 (00:52 +0000)]
i386-cpuinfo.c (FEATURE_AVX2): New enum value.
2012-04-25 Sriraman Tallam <tmsriram@google.com>
* config/i386/i386-cpuinfo.c (FEATURE_AVX2): New enum value.
(get_available_features): New argument. Check for AVX2.
(__cpu_indicator_init): Modify call to get_available_features.
* doc/extend.texi: Document avx2 support.
* config/i386/i386.c (fold_builtin_cpu): Add avx2.
* testsuite/gcc.target/i386/builtin_target.c: Check avx2.
From-SVN: r186855
GCC Administrator [Thu, 26 Apr 2012 00:18:36 +0000 (00:18 +0000)]
Daily bump.
From-SVN: r186854
Alan Modra [Thu, 26 Apr 2012 00:02:12 +0000 (09:32 +0930)]
savres.c: New test.
* gcc.target/powerpc/savres.c: New test.
* gcc.target/powerpc/powerpc.exp: Run it.
From-SVN: r186850
Benjamin Kosnik [Wed, 25 Apr 2012 22:47:52 +0000 (22:47 +0000)]
re PR libstdc++/52689 (static linking with libstdc++ fails)
2012-04-25 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/52689
* testsuite/17_intro/static.cc: Fix.
* testsuite/lib/dg-options.exp (dg-require-static-libstdcxx): New.
From-SVN: r186845
Hans-Peter Nilsson [Wed, 25 Apr 2012 22:33:30 +0000 (22:33 +0000)]
re PR target/53120 (ICE exposing strict_low_part / in/out operand thinko -fno-tree-sra)
PR target/53120
* gcc.dg/torture/pr53120.c: New test.
From-SVN: r186844
Hans-Peter Nilsson [Wed, 25 Apr 2012 22:31:36 +0000 (22:31 +0000)]
re PR target/53120 (ICE exposing strict_low_part / in/out operand thinko -fno-tree-sra)
PR target/53120
* config/cris/cris.md ("*andhi_lowpart_v32")
("*andqi_lowpart_v32"): Change first input-only operand from
a (match_operand ...) to (match_dup 0). Drop alternatives with
const_int-matching constraints for redundancy.
("*andhi_lowpart_non_v32", "*andqi_lowpart_non_v32"): Ditto. Drop
three-operand alternative.
From-SVN: r186843
Jakub Jelinek [Wed, 25 Apr 2012 19:40:31 +0000 (21:40 +0200)]
re PR target/53110 (GCC-4.7 generates stupid x86_64 asm)
PR target/53110
* config/i386/i386.md (and<mode>3): For andq $0xffffffff, reg
instead expand it as zero extension.
From-SVN: r186839
H.J. Lu [Wed, 25 Apr 2012 19:08:23 +0000 (19:08 +0000)]
Assert dbx_reg_number doesn't return INVALID_REGNUM
PR debug/52857
* dwarf2out.c (dbx_reg_number): Assert return value !=
INVALID_REGNUM.
From-SVN: r186837
Jonathan Wakely [Wed, 25 Apr 2012 18:03:03 +0000 (18:03 +0000)]
scoped_allocator (scoped_allocator::__outermost): Do not pass non-POD to varargs function.
* include/std/scoped_allocator (scoped_allocator::__outermost): Do
not pass non-POD to varargs function.
* testsuite/20_util/scoped_allocator/1.cc: Fix test.
From-SVN: r186836
Jakub Jelinek [Wed, 25 Apr 2012 16:59:11 +0000 (18:59 +0200)]
common.opt (flag_debug_types_section): Default to 0.
* common.opt (flag_debug_types_section): Default to 0.
(dwarf_version): Default to 4.
(dwarf_record_gcc_switches): Default to 1.
(dwarf_strict): Default to 0.
* toplev.c (process_options): Don't handle dwarf_strict
or dwarf_version here.
* config/vxworks.c (vxworks_override_options): Don't
test whether dwarf_strict or dwarf_version are negative,
instead test !global_options_set.x_dwarf_*.
* config/darwin.c (darwin_override_options): Default to
dwarf_version 2.
* doc/invoke.texi: Note that -gdwarf-4, -grecord-gcc-switches
and -fno-debug-types-section are now the default.
From-SVN: r186835
Jan Hubicka [Wed, 25 Apr 2012 16:31:42 +0000 (18:31 +0200)]
cgraphunit.c: Update toplevel comment.
* cgraphunit.c: Update toplevel comment.
(tree_rest_of_compilation): Merge into cgraph_expand_function.
(cgraph_analyze_function): Make static.
(cgraph_decide_is_function_needed): Make static.
(cgraph_add_new_function): Use expand_function instead of
rest_of_compilation.
(clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt,
verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph):
Move to cgraph.c
(cgraph_inline_p): Remove.
(cgraph_preserve_function_body_p): Move to ipa-inline-transform.
(init_cgraph): Add comment.
* cgraphbuild.c (record_reference, mark_address, mark_load,
mark_store): Do not call analyze_expr hook.
* cgraph.c: Update toplevel comment.
(clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt,
verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph):
Move fere from cgraphunit.c
(cgraph_mark_force_output_node): Move to cgraph.h
* cgraph.h: Reorder so the comments match the function placement.
(cgraph_analyze_function, cgraph_decide_is_function_needed): Remove.
(cgraph_mark_force_output_node): Move here from cgraph.c
* tree.c (free_lang_data): Do not clear analyze_expr hook.
* ipa-inline-transform.c (preserve_function_body_p): New function.
(inline_transform): Update.
* langhooks.c (lhd_callgraph_analyze_expr): Remove.
* langhooks.h (lang_hooks_for_callgraph): Remove.
(lang_hooks): Remove callgraph.
* tree-inline.c (expand_call_inline): Do not use cgraph_inline_p.
* varpool.c: Remove out of date comment.
* langhooks-def.h (lhd_callgraph_analyze_expr): Remove.
(LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
From-SVN: r186832
Joel Brobecker [Wed, 25 Apr 2012 15:48:28 +0000 (15:48 +0000)]
Update config.sub to 2012-04-18 version from official repo.
ChangeLog:
* config.sub: Update to 2012-04-18 version from official repo.
From-SVN: r186830
Arnaud Charlet [Wed, 25 Apr 2012 15:17:25 +0000 (17:17 +0200)]
[multiple changes]
2012-04-25 Gary Dismukes <dismukes@adacore.com>
* exp_ch9.adb: Add comments on the usage of the
lock-free data structures.
2012-04-25 Vincent Pucci <pucci@adacore.com>
* exp_intr.adb (Expand_Shift): Convert the left
operand and the operator when the type of the call differs from
the type of the operator.
2012-04-25 Geert Bosch <bosch@adacore.com>
* stand.ads: Minor comment fix.
2012-04-25 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch4.adb (Analyze_Slice): Handle the case where the prefix
is a string literal. Retrieve the first index from the base type
when slicing a string literal.
* sem_ch12.adb (Check_Private_View): Move the initialization
of the type inside the loop to reflect the changing index.
* sem_eval.adb (Eval_Relational_Op): Retrieve the first index
from the base type when dealing with a string literal.
* sem_res.adb (Resolve_Slice): Retrieve the first index from
the base type when slicing a string literal.
* sem_util.adb (Is_Internally_Generated_Renaming): New routine.
(Is_Object_Reference): String literals may act
as object references only when they are renamed internally.
(Proper_First_Index): New routine.
* sem_util.ads (Proper_First_Index): New routine.
From-SVN: r186829
Arnaud Charlet [Wed, 25 Apr 2012 15:14:44 +0000 (17:14 +0200)]
[multiple changes]
2012-04-25 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb, csinfo.adb, lib-writ.adb, sem_ch12.adb,
lib-xref.adb: Minor reformatting.
2012-04-25 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch9.adb: Rename Lock_Free_Sub_Type
to Lock_Free_Subprogram. Remove type Subprogram_Id.
Rename LF_Sub_Table to Lock_Free_Subprogram_Table.
(Allow_Lock_Free_Implementation): Renamed to
Allows_Lock_Free_Implementation. Update the comment on
lock-free restrictions. Code clean up and restructuring.
(Build_Lock_Free_Protected_Subprogram_Body): Update the
profile and related comments. Code clean up and restructuring.
(Build_Lock_Free_Unprotected_Subprogram_Body): Update the
profile and related comments. Code clean up and restructuring.
(Comp_Of): Removed.
From-SVN: r186828
Arnaud Charlet [Wed, 25 Apr 2012 15:12:34 +0000 (17:12 +0200)]
[multiple changes]
2012-04-25 Vincent Celier <celier@adacore.com>
* sem_ch12.adb (Inherit_Context): Compare library units, not
names of units, when checking if a unit is already in the context.
2012-04-25 Thomas Quinot <quinot@adacore.com>
* sem_ch3.adb: Reverse_Storage_Order must be propagated to
untagged derived record types.
2012-04-25 Ed Schonberg <schonberg@adacore.com>
* lib-xref.adb: Adjust position of end label.
From-SVN: r186827
Jan Hubicka [Wed, 25 Apr 2012 14:54:21 +0000 (16:54 +0200)]
re PR middle-end/53089 (gfortran.dg/coarray/atomic_1.f90 and gfortran.dg/coarray/registering_1.f90)
PR middle-end/53089
* cgraphunit.c (referred_to_p): Move ahead in file to avoid forward declaration.
(cgraph_finalize_function): Finalize them here.
* symtab.c (dump_symtab): Dump ctors and dtors.
From-SVN: r186820
Jakub Jelinek [Wed, 25 Apr 2012 14:27:08 +0000 (16:27 +0200)]
re PR tree-optimization/52979 (likely wrong code bug w/packed bitfields)
PR middle-end/52979
* stor-layout.c (get_best_mode): Don't return mode with bitsize
larger than maxbits. Don't compute maxbits modulo align.
Also check that unit bytes long store at bitpos / unit * unit
doesn't affect bits beyond bitregion_end.
* expmed.c (store_bit_field_1): Avoid trying insv if OP_MODE MEM
would not fit into bitregion_start ... bitregion_end + 1 bit
region.
(store_split_bit_field): Decrease unit close to end of bitregion_end
if access is restricted in order to avoid mutual recursion.
* gcc.c-torture/compile/pr52979-1.c: New test.
* gcc.c-torture/execute/pr52979-1.c: New test.
* gcc.c-torture/execute/pr52979-2.c: New test.
From-SVN: r186819
Richard Guenther [Wed, 25 Apr 2012 13:30:19 +0000 (13:30 +0000)]
l_fma_float_5.c: Adjust.
2012-04-25 Richard Guenther <rguenther@suse.de>
* gcc.target/i386/l_fma_float_5.c: Adjust.
* gcc.target/i386/l_fma_double_4.c: Likewise.
* gcc.target/i386/l_fma_float_2.c: Likewise.
* gcc.target/i386/l_fma_float_6.c: Likewise.
* gcc.target/i386/l_fma_double_1.c: Likewise.
* gcc.target/i386/l_fma_double_5.c: Likewise.
* gcc.target/i386/l_fma_float_3.c: Likewise.
* gcc.target/i386/l_fma_double_2.c: Likewise.
* gcc.target/i386/l_fma_double_6.c: Likewise.
* gcc.target/i386/l_fma_float_4.c: Likewise.
* gcc.target/i386/l_fma_double_3.c: Likewise.
* gcc.target/i386/l_fma_float_1.c: Likewise.
From-SVN: r186817
Jakub Jelinek [Wed, 25 Apr 2012 11:35:38 +0000 (13:35 +0200)]
re PR tree-optimization/53058 (Another ice in remove_range_assertions)
PR tree-optimization/53058
* double-int.h (double_int_max_value, double_int_min_value): New
prototypes.
* double-int.c (double_int_max_value, double_int_min_value): New
functions.
* tree-vrp.c (register_edge_assert_for_2): Compare mask
for LE_EXPR or GT_EXPR with double_int_max_value
instead of double_int_mask.
* gcc.c-torture/compile/pr53058.c: New test.
From-SVN: r186816
Jan Hubicka [Wed, 25 Apr 2012 11:31:42 +0000 (13:31 +0200)]
re PR middle-end/53088 (gcc.target/i386/pr39082-1.c)
PR middle-end/53088
* gcc.target/i386/pr39082-1.c: Update warning location.
From-SVN: r186815
Richard Guenther [Wed, 25 Apr 2012 11:19:08 +0000 (11:19 +0000)]
tree-vectorizer.h (vect_loop_versioning): Adjust prototype.
2012-04-25 Richard Guenther <rguenther@suse.de>
* tree-vectorizer.h (vect_loop_versioning): Adjust prototype.
* tree-vect-loop.c (vect_transform_loop): Adjust.
* tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): Record
the maximum number of iterations for the epilogue loop.
(vect_loop_versioning): Remove case re-using the peeled
epilogue loop.
From-SVN: r186813
Jakub Jelinek [Wed, 25 Apr 2012 09:14:02 +0000 (11:14 +0200)]
re PR c/52880 (-Woverride-init emitts unexpected error)
PR c/52880
* c-typeck.c (set_nonincremental_init,
set_nonincremental_init_from_string): Pass true instead of false
as IMPLICIT to add_pending_init.
* gcc.dg/pr52880.c: New test.
From-SVN: r186808
Manuel López-Ibáñez [Wed, 25 Apr 2012 08:49:23 +0000 (08:49 +0000)]
c-typeck.c (pop_init_level): Improve diagnostics.
2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-typeck.c (pop_init_level): Improve diagnostics.
testsuite/
* gcc.dg/m-un-2.c: Update.
* gcc.dg/
20011021-1.c: Update.
From-SVN: r186807
Tobias Burnus [Wed, 25 Apr 2012 06:25:48 +0000 (08:25 +0200)]
re PR fortran/52196 (Add -Wrealloc-lhs)
2012-04-25 Tobias Burnus <burnus@net-b.de>
PR fortran/52196
* lang.opt (Wrealloc-lhs, Wrealloc-lhs-all): New flags.
* gfortran.h (gfc_option_t): Add them.
* options.c (gfc_init_options, gfc_post_options,
gfc_handle_option): Handle them.
* invoke.texi: Document them.
* trans-expr.c (realloc_lhs_warning): New function.
(gfc_trans_arrayfunc_assign,
alloc_scalar_allocatable_for_assignment,
gfc_trans_assignment_1): Use it.
2012-04-25 Tobias Burnus <burnus@net-b.de>
PR fortran/52196
* gfortran.dg/realloc_on_assign_14.f90: New.
From-SVN: r186806
Uros Bizjak [Wed, 25 Apr 2012 06:05:26 +0000 (08:05 +0200)]
compare-elim.c (try_eliminate_compare): Also handle operands with implicit extensions.
* compare-elim.c (try_eliminate_compare): Also handle operands with
implicit extensions.
From-SVN: r186805
Ian Lance Taylor [Wed, 25 Apr 2012 04:40:49 +0000 (04:40 +0000)]
re PR go/52341 (crypto/rand FAILs before Solaris 11)
PR go/52341
crypto/rand: Use io.ReadFull when reading from /dev/urandom.
From-SVN: r186803
Ian Lance Taylor [Wed, 25 Apr 2012 04:26:12 +0000 (04:26 +0000)]
re PR go/52583 (Several new go testsuite failues on Solaris)
PR go/52583
net: Solaris fixes.
In particular fix fd_select.go to handle the case where a file
descriptor is closed by one goroutine while another goroutine
is waiting for it.
From-SVN: r186801