Merge lp:~eres/gcc-linaro/SMS_fixes_for_unfreed_memory_4.6 into lp:gcc-linaro/4.6

Proposed by Revital Eres
Status: Merged
Approved by: Ulrich Weigand
Approved revision: no longer in the source branch.
Merged at revision: 106750
Proposed branch: lp:~eres/gcc-linaro/SMS_fixes_for_unfreed_memory_4.6
Merge into: lp:gcc-linaro/4.6
Diff against target: 40 lines (+7/-1)
3 files modified
ChangeLog.linaro (+6/-0)
gcc/ddg.c (+1/-0)
gcc/modulo-sched.c (+0/-1)
To merge this branch: bzr merge lp:~eres/gcc-linaro/SMS_fixes_for_unfreed_memory_4.6
Reviewer Review Type Date Requested Status
Ulrich Weigand (community) Approve
Review via email: mp+60948@code.launchpad.net

Description of the change

Two fixes for unfreed memory in SMS; backport from trunk:

Free sccs field
http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01205.html (approved in trunk)

Avoid unfreed memory when SMS fails
http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01204.html (approved in trunk)

To post a comment you must log in.
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild has taken a snapshot of this branch at r106748 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.6+bzr106748~eres~SMS_fixes_for_unfreed_memory_4.6.tar.xdelta3.xz

and will be built on the following builders:

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.6+bzr106748~eres~SMS_fixes_for_unfreed_memory_4.6
cbuild-ancestor: lp:gcc-linaro/4.6+bzr106747
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-maverick-cbuild114-ursa3-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106748~eres~SMS_fixes_for_unfreed_memory_4.6/logs/armv7l-maverick-cbuild114-ursa3-cortexa9r1

The test suite results changed compared to the branch point lp:gcc-linaro/4.6+bzr106747:
 -PASS: gfortran.dg/allocatable_function_1.f90 -O0 scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O0 scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O1 scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O1 scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O2 scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O2 scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer -funroll-loops scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer -funroll-loops scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O3 -g scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O3 -g scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -Os scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -Os scan-tree-dump-times original "free" 10

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106748~eres~SMS_fixes_for_unfreed_memory_4.6/logs/armv7l-maverick-cbuild114-ursa3-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-maverick-cbuild114-ursa3-cortexa9r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on i686-lucid-cbuild114-scorpius-i686r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106748~eres~SMS_fixes_for_unfreed_memory_4.6/logs/i686-lucid-cbuild114-scorpius-i686r1

The test suite results changed compared to the branch point lp:gcc-linaro/4.6+bzr106747:
 -PASS: gfortran.dg/allocatable_function_1.f90 -O0 scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O0 scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O1 scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O1 scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O2 scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O2 scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer -funroll-loops scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer -funroll-loops scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O3 -fomit-frame-pointer scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -O3 -g scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -O3 -g scan-tree-dump-times original "free" 10
 -PASS: gfortran.dg/allocatable_function_1.f90 -Os scan-tree-dump-times original "free" 10
 +FAIL: gfortran.dg/allocatable_function_1.f90 -Os scan-tree-dump-times original "free" 10

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106748~eres~SMS_fixes_for_unfreed_memory_4.6/logs/i686-lucid-cbuild114-scorpius-i686r1/gcc-testsuite.txt

cbuild-checked: i686-lucid-cbuild114-scorpius-i686r1

Revision history for this message
Ulrich Weigand (uweigand) wrote :

Please have a look at the failing allocatable_function_1.f90 test case; it may be the test needs to be updated since it checks for occurrences of the word "free" ...

review: Needs Fixing
Revision history for this message
Revital Eres (eres) wrote :

It seems that this error occurs becuase the name of the branch contains the word 'free' which adds to the number of times it appears in the dump file:

less allocatable_function_1.f90.003t.original | grep free
        _gfortran_runtime_error_at (&"At line 18 of file /home/eres/linaro/unfree_memory-gcc-linaro/gcc/testsuite/gfortran.dg/allocatable_function_1.f90"[1]{lb: 1 sz: 1}, &"Attempting to allocate already allocated array \'%s\'"[1]{lb: 1 sz: 1}, &"foo2"[1]{lb: 1 sz: 1});
...
  __builtin_free (D.848);
          __builtin_free (D.858);
          __builtin_free (D.872);
          __builtin_free (D.880);
          __builtin_free (D.890);
          __builtin_free (D.905);
          __builtin_free (D.899);
          __builtin_free (D.922);
          __builtin_free (D.931);
          __builtin_free (D.940);

When renaming the branch to not contain the word 'free' the number of 'free' in the dump file are as expected.

Revision history for this message
Ulrich Weigand (uweigand) wrote :

Huh, I see. I guess the test case probably ought to be hardened so that it doesn't depend on the name of the directory it's running in, but I'd say this is not really a priority for us right now.

Given that, the original patch is OK.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2011-05-13 13:42:39 +0000
3+++ ChangeLog.linaro 2011-05-13 16:19:04 +0000
4@@ -1,6 +1,12 @@
5 2011-05-13 Revital Eres <revital.eres@linaro.org>
6
7 gcc/
8+ * ddg.c (free_ddg_all_sccs): Free sccs field in struct ddg_all_sccs.
9+ * modulo-sched.c (sms_schedule): Avoid unfreed memory when SMS fails.
10+
11+2011-05-13 Revital Eres <revital.eres@linaro.org>
12+
13+ gcc/
14 * loop-doloop.c (doloop_condition_get): Support new form of
15 doloop pattern and use prev_nondebug_insn instead of PREV_INSN.
16 * config/arm/thumb2.md (*thumb2_addsi3_compare0): Remove "*".
17
18=== modified file 'gcc/ddg.c'
19--- gcc/ddg.c 2011-05-11 07:15:47 +0000
20+++ gcc/ddg.c 2011-05-13 16:19:04 +0000
21@@ -1016,6 +1016,7 @@
22 for (i = 0; i < all_sccs->num_sccs; i++)
23 free_scc (all_sccs->sccs[i]);
24
25+ free (all_sccs->sccs);
26 free (all_sccs);
27 }
28
29
30=== modified file 'gcc/modulo-sched.c'
31--- gcc/modulo-sched.c 2011-05-11 07:15:47 +0000
32+++ gcc/modulo-sched.c 2011-05-13 16:19:04 +0000
33@@ -1216,7 +1216,6 @@
34 fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC, trip_count);
35 fprintf (dump_file, ")\n");
36 }
37- continue;
38 }
39 else
40 {

Subscribers

People subscribed via source and target branches