[Bug gcov-profile/57165] New: ICE when using -fprofile-use in cgraph.c

2013-05-03 Thread asharif at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57165



 Bug #: 57165

   Summary: ICE when using -fprofile-use in cgraph.c

Classification: Unclassified

   Product: gcc

   Version: unknown

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: gcov-profile

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: asha...@gcc.gnu.org





Created attachment 30030

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=30030

gcda and source files to trigger the ICE.



Please look at the attached tarball. To reproduce:



g++ -fprofile-use -o client_side_detection_service.o

client_side_detection_service.ii  -O2 -fprofile-correction -Wno-error -c

-fno-strict-aliasing -fno-exceptions



This reproduces with gcc-4.7.3.


[Bug gcov-profile/57115] New: Cannot merge separate single counters for function

2013-04-29 Thread asharif at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57115



 Bug #: 57115

   Summary: Cannot merge separate single counters for function

Classification: Unclassified

   Product: gcc

   Version: unknown

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: gcov-profile

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: asha...@gcc.gnu.org





Created attachment 29975

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29975

source + .gcda file.



These files are from profiling WebKit.



To reproduce the error, run:



g++ -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wall

-Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe

-fPIC -g -fno-strict-aliasing -O2 -fno-ident -fdata-sections

-ffunction-sections -g -Wno-c++0x-compat -fno-rtti -fno-threadsafe-statics

-fvisibility-inlines-hidden -Wsign-compare -fstack-protector-strong

-fprofile-use -fprofile-correction -o EventContext.o EventContext.ii



This was run on a system that defines TARGET_POSIX_IO so there shouldn't be a

problem writing profiles from multiple threads/processes, right?


[Bug gcov-profile/49484] gcov crash if two(or more) forks happen at the same time

2012-12-06 Thread asharif at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49484



--- Comment #26 from asharif at gcc dot gnu.org 2012-12-06 20:09:35 UTC ---

Author: asharif

Date: Thu Dec  6 20:09:25 2012

New Revision: 194264



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=194264

Log:

2012-12-03  Ahmad Sharif asha...@google.com



Backport r185231 from trunk.



2012-03-12  Richard Guenther  rguent...@suse.de



* gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.

* gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.

(__gthread_mutex_init_function): New function.

* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.



PR gcov/49484

* libgcov.c: Include gthr.h.

(__gcov_flush_mx): New global variable.

(init_mx, init_mx_once): New functions.

(__gcov_flush): Protect self with a mutex.

(__gcov_fork): Re-initialize mutex after forking.

* unwind-dw2-fde.c: Change condition under which to use

__GTHREAD_MUTEX_INIT_FUNCTION.





Modified:

branches/google/gcc-4_7/   (props changed)

branches/google/gcc-4_7/gcc/   (props changed)

branches/google/gcc-4_7/gcc/testsuite/gcc.target/powerpc/ppc-round.c  

(props changed)

branches/google/gcc-4_7/libgcc/ChangeLog

branches/google/gcc-4_7/libgcc/ChangeLog.google-4_7

branches/google/gcc-4_7/libgcc/gthr-posix.h

branches/google/gcc-4_7/libgcc/gthr-single.h

branches/google/gcc-4_7/libgcc/gthr.h

branches/google/gcc-4_7/libgcc/libgcov.c

branches/google/gcc-4_7/libgcc/unwind-dw2-fde.c

branches/google/gcc-4_7/libjava/classpath/   (props changed)



Propchange: branches/google/gcc-4_7/

('svn:mergeinfo' modified)



Propchange: branches/google/gcc-4_7/gcc/

('svn:mergeinfo' modified)



Propchange:

branches/google/gcc-4_7/gcc/testsuite/gcc.target/powerpc/ppc-round.c

('svn:mergeinfo' modified)



Propchange: branches/google/gcc-4_7/libjava/classpath/

('svn:mergeinfo' modified)


[Bug gcov-profile/49484] gcov crash if two(or more) forks happen at the same time

2012-12-06 Thread asharif at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49484



--- Comment #27 from asharif at gcc dot gnu.org 2012-12-07 02:35:42 UTC ---

Author: asharif

Date: Fri Dec  7 02:35:37 2012

New Revision: 194279



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=194279

Log:

2012-12-03  Ahmad Sharif asha...@google.com



Backport r185231 from trunk.



2012-03-12  Richard Guenther  rguent...@suse.de



* gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.

* gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.

(__gthread_mutex_init_function): New function.

* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.



PR gcov/49484

* libgcov.c: Include gthr.h.

(__gcov_flush_mx): New global variable.

(init_mx, init_mx_once): New functions.

(__gcov_flush): Protect self with a mutex.

(__gcov_fork): Re-initialize mutex after forking.

* unwind-dw2-fde.c: Change condition under which to use

__GTHREAD_MUTEX_INIT_FUNCTION.





Modified:

branches/google/gcc-4_7-mobile/   (props changed)

branches/google/gcc-4_7-mobile/gcc/   (props changed)

branches/google/gcc-4_7-mobile/gcc/testsuite/gcc.target/powerpc/ppc-round.c

  (props changed)

branches/google/gcc-4_7-mobile/libgcc/ChangeLog.google-4_7

branches/google/gcc-4_7-mobile/libgcc/gthr-posix.h

branches/google/gcc-4_7-mobile/libgcc/gthr-single.h

branches/google/gcc-4_7-mobile/libgcc/gthr.h

branches/google/gcc-4_7-mobile/libgcc/libgcov.c

branches/google/gcc-4_7-mobile/libgcc/unwind-dw2-fde.c

branches/google/gcc-4_7-mobile/libjava/classpath/   (props changed)



Propchange: branches/google/gcc-4_7-mobile/

('svn:mergeinfo' modified)



Propchange: branches/google/gcc-4_7-mobile/gcc/

('svn:mergeinfo' modified)



Propchange:

branches/google/gcc-4_7-mobile/gcc/testsuite/gcc.target/powerpc/ppc-round.c

('svn:mergeinfo' modified)



Propchange: branches/google/gcc-4_7-mobile/libjava/classpath/

('svn:mergeinfo' modified)


[Bug other/54398] Incorrect ARM assembly when building with -fno-omit-frame-pointer -O2

2012-09-04 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54398

asharif at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #28096|0   |1
is obsolete||

--- Comment #2 from asharif at gcc dot gnu.org 2012-09-04 22:47:15 UTC ---
Created attachment 28131
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28131
Repro case


[Bug other/54398] Incorrect ARM assembly when building with -fno-omit-frame-pointer -O2

2012-09-04 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54398

--- Comment #3 from asharif at gcc dot gnu.org 2012-09-04 22:48:51 UTC ---
Sorry about that.

Attached is a preprocessed file that reproduces the bug.

gcc version: gcc-4.6.4 at 19788:190734 (as reported by svnversion -c)
system type: arm linux
configured as: configure --disable-multilib --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/armv7a-cros-linux-gnueabi/gcc-bin/4.6.4
--datadir=/usr/share/gcc-data/armv7a-cros-linux-gnueabi/4.6.4
--mandir=/usr/share/gcc-data/armv7a-cros-linux-gnueabi/4.6.4/man
--infodir=/usr/share/gcc-data/armv7a-cros-linux-gnueabi/4.6.4/info
--includedir=/usr/lib/gcc/armv7a-cros-linux-gnueabi/4.6.4/include
--with-gxx-include-dir=/usr/lib/gcc/armv7a-cros-linux-gnueabi/4.6.4/include/g++-v4
--host=x86_64-pc-linux-gnu --target=armv7a-cros-linux-gnueabi
--build=x86_64-pc-linux-gnu --enable-languages=c,c++ --with-float=hard
--with-mode=thumb --with-sysroot=/usr/armv7a-cros-linux-gnueabi
--disable-libmudflap --disable-libssp --enable-libgomp --enable-__cxa_atexit
--enable-checking=release --disable-libquadmath --with-arch=armv7-a
--disable-esp --enable-linker-build-id
command line: armv7a-cros-linux-gnueabi-g++ -fno-exceptions
-Wno-unused-parameter -Wno-missing-field-initializers -D_FILE_OFFSET_BITS=64
-fvisibility=hidden -pipe -fPIC -fno-strict-aliasing -g -mthumb
-Wa,-mimplicit-it=thumb -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard
-mfpu=neon -O2 -fno-ident -fdata-sections -ffunction-sections -fno-rtti
-fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare
-Wno-invalid-offsetof -Wno-multichar -Wno-sign-compare -Wno-abi -O2 -pipe
-march=armv7-a -mtune=cortex-a15 -mfpu=neon -mfloat-abi=hard -g
-fno-omit-frame-pointer -o reduced.out reduced.ii
# There is no compiler output
# When I run this on an ARM box, I get this output from the binary:

p1.x 0
p1.y 0
p2.x 5
p2.y 5
p3.x 10
p3.y 10
p1.x 4
p1.y 4
p2.x 762508 # This is 7 with -fomit-frame-pointer
p2.y 7
p3.x 10
p3.y 10
p1.x 0
p1.y 0
p2.x 569140 # this is 2 with -fomit-frame-pointer
p2.y 0
p3.x 4
p3.y 4


[Bug other/54398] New: Incorrect ARM assembly when building with -fno-omit-frame-pointer -O2

2012-08-28 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54398

 Bug #: 54398
   Summary: Incorrect ARM assembly when building with
-fno-omit-frame-pointer -O2
Classification: Unclassified
   Product: gcc
   Version: 4.6.4
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: asha...@gcc.gnu.org


Created attachment 28096
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=28096
Reduced test case

Please see the attached cpp and h files.

I used gcc-4.6.4 at 19788:190734 (as reported by svnversion -c).

Configured it as follows:

configure --disable-multilib --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/armv7a-cros-linux-gnueabi/gcc-bin/4.6.4
--datadir=/usr/share/gcc-data/armv7a-cros-linux-gnueabi/4.6.4
--mandir=/usr/share/gcc-data/armv7a-cros-linux-gnueabi/4.6.4/man
--infodir=/usr/share/gcc-data/armv7a-cros-linux-gnueabi/4.6.4/info
--includedir=/usr/lib/gcc/armv7a-cros-linux-gnueabi/4.6.4/include
--with-gxx-include-dir=/usr/lib/gcc/armv7a-cros-linux-gnueabi/4.6.4/include/g++-v4
--host=x86_64-pc-linux-gnu --target=armv7a-cros-linux-gnueabi
--build=x86_64-pc-linux-gnu --enable-languages=c,c++ --with-float=hard
--with-mode=thumb --with-sysroot=/usr/armv7a-cros-linux-gnueabi
--disable-libmudflap --disable-libssp --enable-libgomp --enable-__cxa_atexit
--enable-checking=release --disable-libquadmath --with-arch=armv7-a
--disable-esp --enable-linker-build-id

Built my file as follows:

g++ -fno-exceptions -Wno-unused-parameter -Wno-missing-field-initializers
-D_FILE_OFFSET_BITS=64 -fvisibility=hidden -pipe -fPIC -fno-strict-aliasing -g
-mthumb -Wa,-mimplicit-it=thumb -march=armv7-a -mtune=cortex-a8
-mfloat-abi=hard -mfpu=neon -O2 -fno-ident -fdata-sections -ffunction-sections
-fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare
-Wno-invalid-offsetof -Wno-multichar -Wno-sign-compare -Wno-abi -O2 -pipe
-march=armv7-a -mtune=cortex-a15 -mfpu=neon -mfloat-abi=hard -g
-fno-omit-frame-pointer -o reduced.out reduced.cpp

The final binary is called reduced.out, and produces different output at -O0
and -O2 with -fno-omit-frame-pointer.

At -O0 (as well as for x86 backend):

p1.x 0
p1.y 0
p2.x 5
p2.y 5
p3.x 10
p3.y 10
p1.x 4
p1.y 4
p2.x 7
p2.y 7
p3.x 10
p3.y 10
p1.x 0
p1.y 0
p2.x 2
p2.y 2
p3.x 4
p3.y 4

At -fno-omit-frame-pointer -O2:

p1.x 0
p1.y 0
p2.x 5
p2.y 5
p3.x 10
p3.y 10
p1.x 4
p1.y 4
p2.x 777508
p2.y 7
p3.x 10
p3.y 10
p1.x 0
p1.y 0
p2.x 777492
p2.y 79193
p3.x 4
p3.y 4


In the assembly, I see:

 7a6:   6139str r1, [r7, #16] # Note non-0-offset from r7
 7a8:   f8c7 9014   str.w   r9, [r7, #20] # Note non-0-offset from r7
 7ac:   e893 0003   ldmia.w r3, {r0, r1}
 7b0:   e884 0003   stmia.w r4, {r0, r1}
 7b4:   e897 0003   ldmia.w r7, {r0, r1} # Note 0-offset from r7
 7b8:   e88c 0003   stmia.w ip, {r0, r1}

The two offsets should match otherwise we are using garbage values.


[Bug gcov-profile/53546] gcc ICEs when using -fripa at varpool.c:45

2012-07-10 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53546

--- Comment #2 from asharif at gcc dot gnu.org 2012-07-10 11:43:31 UTC ---
-fripa is the IPA optimizer in the google/* branches of gcc. It does
lightweight IPO based on PGO/FDO.


[Bug gcov-profile/53547] Changing the source file between -fprofile-generate and -fprofile-use can lead to performance degradation

2012-07-10 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53547

--- Comment #3 from asharif at gcc dot gnu.org 2012-07-10 12:00:21 UTC ---
+cc: Jan Hubicka

The use case here represents what happened as we were deploying for Chrome (the
browser). Chrome is a moving source base and they did not want to integrate PGO
into their build system. Doing so would require their nightly builders to run
instrumented Chrome binaries on various devices (example, x86- and arm- based
devices), get the PGO data and rebuild the optimized binary.

Instead they wanted to generate PGO data offline and use it for slightly newer
code. That way they could decouple the generation of PGO data from their build
system. That is understandable because changing the build systems for large
projects is a tedious task.

Currently there are problems with offline PGO:

1. gcc can ICE in certain situations when the profile is out of date.
2. gcc thinks that the mismatched functions execute exactly 0 times and still
considers the program summary of PGO to be valid (that includes run_max,
sum_max, etc.). This misleads gcc into believing that the hot functions are
cold (if they have mismatches).

gcc should distinguish the case where the edge counts are truly 0, vs. the case
where there is a profile mismatch. My patch addresses that.

In general, I think PGO will get higher adoption if we make it resilient to
slight changes in source code. That way developers can generate good PGO data
independently of their nightly builds.

Right now the situation is such that gcc's profile files have function ids with
checksums instead of function names. If we add a single dummy function to the
compilation unit, all the function ids are different and the entire profile
file has checksum mismatches. My patch just addresses a part of the problem. If
gcc uses function names instead of ids, gcc will be able to tolerate more
source changes and I think PGO adoption will increase.


[Bug gcov-profile/53546] New: gcc ICEs when using -fripa at varpool.c:45

2012-05-31 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53546

 Bug #: 53546
   Summary: gcc ICEs when using -fripa at varpool.c:45
Classification: Unclassified
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: asha...@gcc.gnu.org


Created attachment 27535
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27535
Proposed patch to fix this problem.

This only happens in -fripa compilation mode under some circumstances.

The reason is that in dwarf2asm.c dw2_output_indirect_constant_1, we do not
copy the TREE_STATIC() property from id to decl.

I am attaching a patch that fixes this problem.


[Bug gcov-profile/53547] New: Changing the source file between -fprofile-generate and -fprofile-use can lead to performance degradation

2012-05-31 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53547

 Bug #: 53547
   Summary: Changing the source file between -fprofile-generate
and -fprofile-use can lead to performance degradation
Classification: Unclassified
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: asha...@gcc.gnu.org


Created attachment 27536
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27536
Test case.

Please take a look at the attached test case.

gcc -O2 -fprofile-generate test.c
rm -rf test.gcda  ./a.out
gcc -O2 -fprofile-use -DSTALE test.c

Note that with -DSTALE, a function is added which changes the function id
ordering within the module. With this re-ordering, the profile data no longer
matches up with the updated source file.

What is worse is that the performance actually *drops* below that of regular
-O2 (without -fprofile-use). This is because the summary information (sum_max,
etc.) is still valid while the edge count is considered to be 0 for all edges.
This leads to pessimistic inlining decisions.

Here is a patch that fixes solves the performance loss:
http://codereview.appspot.com/5989046/


[Bug gcov-profile/53547] Changing the source file between -fprofile-generate and -fprofile-use can lead to performance degradation

2012-05-31 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53547

--- Comment #1 from asharif at gcc dot gnu.org 2012-06-01 00:22:06 UTC ---
Created attachment 27537
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27537
Proposed fix.


[Bug gcov-profile/49484] gcov crash if two(or more) forks happen at the same time

2012-05-02 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49484

--- Comment #25 from asharif at gcc dot gnu.org 2012-05-02 22:52:36 UTC ---
Author: asharif
Date: Wed May  2 22:52:28 2012
New Revision: 187067

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=187067
Log:
Backported r187026 from branches/google/gcc-4_6.

2012-03-12  Richard Guenther  rguent...@suse.de

* gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.
* gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
(__gthread_mutex_init_function): New function.
* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.

PR gcov/49484
* libgcov.c: Include gthr.h.
(__gcov_flush_mx): New global variable.
(init_mx, init_mx_once): New functions.
(__gcov_flush): Protect self with a mutex.
(__gcov_fork): Re-initialize mutex after forking.
* unwind-dw2-fde.c: Change condition under which to use
__GTHREAD_MUTEX_INIT_FUNCTION.

Modified:
branches/google/gcc-4_6_3-mobile/   (props changed)
branches/google/gcc-4_6_3-mobile/gcc/ChangeLog.google-4_6
branches/google/gcc-4_6_3-mobile/gcc/gthr-posix.h
branches/google/gcc-4_6_3-mobile/gcc/gthr-single.h
branches/google/gcc-4_6_3-mobile/gcc/gthr.h
branches/google/gcc-4_6_3-mobile/gcc/libgcov.c
branches/google/gcc-4_6_3-mobile/gcc/unwind-dw2-fde.c
branches/google/gcc-4_6_3-mobile/libgcc/ChangeLog
branches/google/gcc-4_6_3-mobile/libgcc/ChangeLog.google-4_6

Propchange: branches/google/gcc-4_6_3-mobile/
('svn:mergeinfo' modified)


[Bug gcov-profile/49484] gcov crash if two(or more) forks happen at the same time

2012-05-01 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49484

--- Comment #24 from asharif at gcc dot gnu.org 2012-05-01 21:22:51 UTC ---
Author: asharif
Date: Tue May  1 21:22:47 2012
New Revision: 187026

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=187026
Log:
Backported r185231 from trunk.

2012-03-12  Richard Guenther  rguent...@suse.de

* gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.
* gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
(__gthread_mutex_init_function): New function.
* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.

PR gcov/49484
* libgcov.c: Include gthr.h.
(__gcov_flush_mx): New global variable.
(init_mx, init_mx_once): New functions.
(__gcov_flush): Protect self with a mutex.
(__gcov_fork): Re-initialize mutex after forking.
* unwind-dw2-fde.c: Change condition under which to use
__GTHREAD_MUTEX_INIT_FUNCTION.

Modified:
branches/google/gcc-4_6/   (props changed)
branches/google/gcc-4_6/gcc/ChangeLog.google-4_6
branches/google/gcc-4_6/gcc/gthr-posix.h
branches/google/gcc-4_6/gcc/gthr-single.h
branches/google/gcc-4_6/gcc/gthr.h
branches/google/gcc-4_6/gcc/libgcov.c
branches/google/gcc-4_6/gcc/unwind-dw2-fde.c
branches/google/gcc-4_6/libgcc/ChangeLog

Propchange: branches/google/gcc-4_6/
('svn:mergeinfo' modified)


[Bug gcov-profile/51975] ICE in gcc in convert_move, at expr.c:326 with fprofile-use when source changes from fprofile-generate

2012-01-24 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51975

asharif at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #26439|0   |1
is obsolete||

--- Comment #2 from asharif at gcc dot gnu.org 2012-01-24 20:01:45 UTC ---
Created attachment 26445
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26445
Proposed fix.

Reused the counts_hash table.


[Bug gcov-profile/51975] ICE in gcc in convert_move, at expr.c:326 with fprofile-use when source changes from fprofile-generate

2012-01-24 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51975

asharif at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #26445|0   |1
is obsolete||

--- Comment #3 from asharif at gcc dot gnu.org 2012-01-24 20:10:21 UTC ---
Created attachment 26446
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26446
Proposed fix.


[Bug gcov-profile/51975] New: ICE in gcc in convert_move, at expr.c:326 with fprofile-use when source changes from fprofile-generate

2012-01-23 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51975

 Bug #: 51975
   Summary: ICE in gcc in convert_move, at expr.c:326 with
fprofile-use when source changes from
fprofile-generate
Classification: Unclassified
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: asha...@gcc.gnu.org


Created attachment 26438
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26438
Tarball containing the test files and the proposed fix.

Please see attached testcase, which fails with gcc-4.6.0:

gcc -o profile_io_data.o profile_io_data.ii -O2 -Wno-error -fpermissive
-fprofile-use -m32 -c

This happens because the profile .gcda file is oudated compared to the current
source. gcc's assignment of function ids on the current source is different
from the assignment when it did fprofile-generate. This causes an ICE later
down the pipeline.

I am also attaching a proposed fix, which builds a hash table of function ids
- cfg checksums when reading in the profile files. At profile use time, in
check_ic_target(), gcc makes sure the target function's checksum matches the
checksum that is found in the gcda file.


[Bug gcov-profile/51975] ICE in gcc in convert_move, at expr.c:326 with fprofile-use when source changes from fprofile-generate

2012-01-23 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51975

--- Comment #1 from asharif at gcc dot gnu.org 2012-01-24 00:55:14 UTC ---
Created attachment 26439
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26439
Proposed fix.

Here is just the patch if you want to take a quick look at it.


[Bug tree-optimization/47447] [4.3/4.4 Regression] Unable to coalesce ssa_names x and y ICE in tree-ssa-coalesce.c when -O3 is used

2011-03-01 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47447

--- Comment #8 from asharif at gcc dot gnu.org 2011-03-01 19:39:49 UTC ---
Ping. Andrew or Richard, how can I rework my patch to address this issue?

Thanks,


[Bug tree-optimization/47447] [4.3/4.4 Regression] Unable to coalesce ssa_names x and y ICE in tree-ssa-coalesce.c when -O3 is used

2011-02-03 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47447

--- Comment #3 from asharif at gcc dot gnu.org 2011-02-03 22:19:10 UTC ---
Created attachment 23242
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23242
This patch fixes the problem, but may be pessimistic.


[Bug tree-optimization/47447] [4.3/4.4 Regression] Unable to coalesce ssa_names x and y ICE in tree-ssa-coalesce.c when -O3 is used

2011-02-03 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47447

--- Comment #4 from asharif at gcc dot gnu.org 2011-02-03 22:19:37 UTC ---
Richard, check out the attached patch and let me know your thoughts.


[Bug gcov-profile/47363] value-profile.c produces incorrect error message when *count *all

2011-02-03 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363

asharif at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #6 from asharif at gcc dot gnu.org 2011-02-03 22:22:31 UTC ---
Fixed in r169387.

http://gcc.gnu.org/viewcvs?view=revisionrevision=169387


[Bug tree-optimization/47447] [4.3/4.4 Regression] Unable to coalesce ssa_names x and y ICE in tree-ssa-coalesce.c when -O3 is used

2011-02-03 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47447

--- Comment #6 from asharif at gcc dot gnu.org 2011-02-03 22:25:01 UTC ---
What happens is tree vectorization introduces code in the preheader to check
for the loop iterations at runtime. The expression holding the number of
iterations may contain ssa names that are abnormal. This may extend their live
range (that is what happens in this testcase) and make them conflict with other
abnormal names.

That leads to an ICE.

I wonder what the other passes do that hoist such code effectively extending
the live ranges of abnormal ssa names.


[Bug tree-optimization/47447] [4.3/4.4 Regression] Unable to coalesce ssa_names x and y ICE in tree-ssa-coalesce.c when -O3 is used

2011-02-03 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47447

--- Comment #7 from asharif at gcc dot gnu.org 2011-02-03 22:26:48 UTC ---
(In reply to comment #5)
 I almost want to say LOOP_VINFO_NITERS should not have abnormal SSA's to begin
 with.

Andrew, shouldn't it be fine to have abnormal SSAs as long as they don't
conflict? That may be the best solution -- i.e. bailing out only if they will
conflict later on, as opposed to what my patch does (it bails out as soon as an
abnormal name is detected).


[Bug tree-optimization/47447] [4.3/4.4 Regression] Unable to coalesce ssa_names x and y ICE in tree-ssa-coalesce.c when -O3 is used

2011-01-26 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47447

--- Comment #2 from asharif at gcc dot gnu.org 2011-01-26 21:50:26 UTC ---
It seems like this bug is reproducible on older versions of the trunk.

This change:

http://gcc.gnu.org/viewcvs?view=revisionrevision=146776

seems to suppress it (or fix it?). Jan Hubicka is the original author of this
patch (from pretty-ipa I believe) and Richard brought it into mainline.

Jan, can you comment on this bug and confirm that your change does indeed fix
it?


[Bug gcov-profile/47363] value-profile.c produces incorrect error message when *count *all

2011-01-24 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363

asharif at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #23032|0   |1
is obsolete||

--- Comment #2 from asharif at gcc dot gnu.org 2011-01-24 21:09:47 UTC ---
Created attachment 23109
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23109
Patch to fix this problem.

The patch now has a more appropriate error message.


[Bug tree-optimization/47447] New: Unable to coalesce ssa_names x and y ICE in tree-ssa-coalesce.c when -O3 is used

2011-01-24 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47447

   Summary: Unable to coalesce ssa_names x and y ICE in
tree-ssa-coalesce.c when -O3 is used
   Product: gcc
   Version: 4.4.6
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: asha...@gcc.gnu.org


Created attachment 23110
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23110
This is the input file to the compiler that produces an ICE.

To reproduce, use the attached file and run:

g++ -o /dev/null -S -O3 reduced.manual.inline.cc

You will get this message:

Unable to coalesce ssa_names x and y which are marked as MUST COALESCE.

This is reproducible with the latest (as of Jan 20th, 2011) 4-4 branch of gcc.
It seems to not happen with the trunk.


[Bug gcov-profile/47363] value-profile.c produces incorrect error message when *count *all

2011-01-24 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363

asharif at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #23109|0   |1
is obsolete||

--- Comment #3 from asharif at gcc dot gnu.org 2011-01-24 21:22:33 UTC ---
Created attachment 23111
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23111
I forgot a space earlier. It is fixed in this version now.

Updated patch.


[Bug gcov-profile/47363] value-profile.c produces incorrect error message when *count *all

2011-01-24 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363

asharif at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #23111|0   |1
is obsolete||

--- Comment #4 from asharif at gcc dot gnu.org 2011-01-24 21:32:29 UTC ---
Created attachment 23112
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23112
The patch now has the original corrupted value profile: %s line.

Added original line.


[Bug gcov-profile/47363] value-profile.c produces incorrect error message when *count *all

2011-01-24 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363

asharif at gcc dot gnu.org changed:

   What|Removed |Added

  Attachment #23112|0   |1
is obsolete||

--- Comment #5 from asharif at gcc dot gnu.org 2011-01-24 21:38:50 UTC ---
Created attachment 23113
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23113
Patch to fix this problem.

Fixed indentation.


[Bug gcov-profile/47363] New: value-profile.c produces incorrect error message when *count *all

2011-01-19 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47363

   Summary: value-profile.c produces incorrect error message when
*count  *all
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: asha...@gcc.gnu.org


Created attachment 23032
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=23032
Patch that adds a helpful error message when the profile is corrupted.

When a profile is corrupted and *count  *all (in value-prof.c) around line
473, an incorrect message is generated. This message reads:

profiler overall count (%d) does not match BB count (%d)

The integers in parentheses are actually equal so the message is confusing to
the user.

There should be a better error message generated in this case, pointing the
user to what went wrong.

I am attaching a patch that fixes this (I'll also be sending out an email to
the mailing list).


[Bug testsuite/46895] FAIL: gcc.target/i386/max-stack-align.c

2010-12-13 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46895

asharif at gcc dot gnu.org changed:

   What|Removed |Added

 CC||asharif at gcc dot gnu.org

--- Comment #4 from asharif at gcc dot gnu.org 2010-12-13 17:49:40 UTC ---
(In reply to comment #3)
 Yeah, if #c2 tests what the test meant to test, then it is much preferrable
 over the thing that got committed, which has lots of issues.

Sorry about the trunk breakage. I reverted the testcase. Yes, it was meant for
x86-64. I'll fix the testcase and repost a patch to the mailing list.

Reverted in r167756.


[Bug testsuite/46895] FAIL: gcc.target/i386/max-stack-align.c

2010-12-13 Thread asharif at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46895

--- Comment #5 from asharif at gcc dot gnu.org 2010-12-13 18:49:50 UTC ---
(In reply to comment #4)
 (In reply to comment #3)
  Yeah, if #c2 tests what the test meant to test, then it is much preferrable
  over the thing that got committed, which has lots of issues.
 
 Sorry about the trunk breakage. I reverted the testcase. Yes, it was meant for
 x86-64. I'll fix the testcase and repost a patch to the mailing list.
 
 Reverted in r167756.

Update:

The test doesn't do what #c3 is doing. The test is supposed to fail with this
patch: http://gcc.gnu.org/viewcvs?view=revisionrevision=153780 and pass
otherwise. That patch limits the alignment to MAX_SUPPORTED_STACK_ALIGNMENT. 

The test described in #c3 will still pass with that patch. 


As far as the uninitialized variables are concerned, I can set them all to 0
and it doesn't affect whether the test passes or fails.

Can you assign this bug to me?

Also, can I submit my patch with the lp64 dejaGNU filter?

Thanks!