This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Remaining fixes to get MINIMIZED through test suite


This patch makes two minor corrections to fix two remaining tests in
the test suite that failed if run with -gnato2 forced on. There is
also a minor optimization of Compile_Time_Compare which improves
the results in some cases (noticed during testing, but does not
have any effect on the test suite).

The first problem was in handling folding of /= in some cases
which showed up as a bogus complaint about a length check failing.
The following should compile cleanly with -gnato2 with no messages.

     1. procedure Compov2 is
     2. begin
     3.    for J in 1 .. 1 loop
     4.       declare
     5.          Dest   : constant Wide_String (J .. J + 6) := "is_copy";
     6.       begin
     7.          null;
     8.       end;
     9.    end loop;
    10. end;

The other case was a mistake in handling of case expressions, which
shows up as an unexpected constraint error. No simple test case is
available for this problem.

Tested on x86_64-pc-linux-gnu, committed on trunk

2012-10-04  Robert Dewar  <dewar@adacore.com>

	* checks.adb (Minimize_Eliminate_Overflow_Checks): Dont reanalyze
	if/case expression if nothing has changed (just reexpand). Stops
	case expression from generating incorrect temporary.
	* exp_ch4.adb (Expand_Compare_Minimize_Eliminate_Overflow):
	Fix cut and paste typo for range analysis in NE (not equal) case.
	* sem_eval.adb (Compile_Time_Compare): Small optimization to
	catch some more cases.
	* types.ads (Suppressed_Or_Checked): New subtype of
	Overflow_Check_Type.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]