public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code
@ 2012-03-09 17:30 jgpiccinali at free dot fr
  2012-03-10  7:51 ` [Bug middle-end/52544] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jgpiccinali at free dot fr @ 2012-03-09 17:30 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52544
           Summary: compilation fails with -finstrument-functions and sse
                    c code
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jgpiccinali@free.fr


Created attachment 26866
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26866
the src code that reproduce the issue.

Hi,

I'd like to report an issue with gcc versions >= 4.6.x :
when compiling my sse.c code with "gcc -Wall -Wextra -fno-strict-aliasing
-fwrapv sse.c", 
all versions of gcc (434, 453, 462, 463, 47 and 480) create a correct
executable, 
that will give the correct output at runtime : 

    * x = [1.250000 1.250000 1.250000 1.250000]

BUT 

if i add "-finstrument-functions" to the compilation line, 
then only version < 4.6.x (versions 434 and 453 in my tests) will compile my
code, 
otherwise (= gcc versions 462, 463, 47 and 480), compilation will stop with the
following message :

    * /tmp/cckYj6ai.o: In function `main':
    * sse.c:(.text+0x2a): undefined reference to `_mm_set1_ps'
    * sse.c:(.text+0x50): undefined reference to `_mm_set1_ps'
    * sse.c:(.text+0x79): undefined reference to `_mm_store_ps'
    * sse.c:(.text+0x95): undefined reference to `_mm_store_ps'
    * collect2: ld returned 1 exit status

gcc was compiled with :
        configure \
                  --enable-languages=c \
                  --enable-threads=posix \
                  --enable-shared \
                  --with-mpfr=/apps/rothorn/mpfr/3.0.0/gcc-4.3.4 \
                  --with-gmp=/apps/rothorn/gmp/4.3.2/gcc-4.3.4 \
                  --with-mpc=/apps/rothorn/mpc/0.8.2/gcc-4.3.4

gcc/4.7   was compiled with revision 184577 of the svn.
gcc/4.8.0 was compiled with revision 185132 of the svn.
Tested on GNU/Linux with Intel (Ubuntu/11.04) and AMD (SLES/11.1) cpus.

What's wrong please ?

Thanks in advance for your help.

The original src is sse.c :
#include <stdio.h>
#include <xmmintrin.h>

int main(void)
{
        float xf[4];
        __m128 x = _mm_set1_ps(1.25f);
        _mm_store_ps(&xf[0], x);
        printf("x = [%f %f %f %f]\n", xf[0], xf[1], xf[2], xf[3]);
        return 0;
}

The preprocessed src (with gcc version 4.6.3) is attached, and the full output
is here :


rothorn:/apps/rothorn/sandbox/jgp/gcc/bugA $ ./463 -v -save-temps -Wall -Wextra
-fno-strict-aliasing -fwrapv sse.c -finstrument-functions 

Using built-in specs.
COLLECT_GCC=./463
COLLECT_LTO_WRAPPER=/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /apps/rothorn/sandbox/jgp/gcc/src/gcc-4.6.3/configure
--prefix=/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434 --enable-languages=c
--enable-threads=posix --enable-shared
--with-mpfr=/apps/rothorn/mpfr/3.0.0/gcc-4.3.4
--with-gmp=/apps/rothorn/gmp/4.3.2/gcc-4.3.4
--with-mpc=/apps/rothorn/mpc/0.8.2/gcc-4.3.4
Thread model: posix
gcc version 4.6.3 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-fno-strict-aliasing'
'-fwrapv' '-finstrument-functions' '-mtune=generic' '-march=x86-64'

/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/cc1
-E -quiet -v sse.c -mtune=generic -march=x86-64 -Wall -Wextra
-fno-strict-aliasing -fwrapv -finstrument-functions -fpch-preprocess -o sse.i
ignoring nonexistent directory
"/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include
 /usr/local/include
 /apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/include

/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-fno-strict-aliasing'
'-fwrapv' '-finstrument-functions' '-mtune=generic' '-march=x86-64'

/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/cc1
-fpreprocessed sse.i -quiet -dumpbase sse.c -mtune=generic -march=x86-64
-auxbase sse -Wall -Wextra -version -fno-strict-aliasing -fwrapv
-finstrument-functions -o sse.s
GNU C (GCC) version 4.6.3 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.6.3, GMP version 4.3.2, MPFR version 3.0.0, MPC
version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C (GCC) version 4.6.3 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.6.3, GMP version 4.3.2, MPFR version 3.0.0, MPC
version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 221f59dff4d036c76c9a0dfc4c602ad0
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-fno-strict-aliasing'
'-fwrapv' '-finstrument-functions' '-mtune=generic' '-march=x86-64'
 as --64 -o sse.o sse.s
COMPILER_PATH=/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/:/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/:/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/libexec/gcc/x86_64-unknown-linux-gnu/:/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/:/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/:/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-fno-strict-aliasing'
'-fwrapv' '-finstrument-functions' '-mtune=generic' '-march=x86-64'

/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/collect2
--eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2
/usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/crtbegin.o
-L/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3
-L/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../..
sse.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed
/apps/rothorn/sandbox/jgp/gcc/4.6.3/gnu434/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/crtend.o
/usr/lib/../lib64/crtn.o
sse.o: In function `main':
sse.c:(.text+0x2a): undefined reference to `_mm_set1_ps'
sse.c:(.text+0x50): undefined reference to `_mm_set1_ps'
sse.c:(.text+0x79): undefined reference to `_mm_store_ps'
sse.c:(.text+0x95): undefined reference to `_mm_store_ps'
collect2: ld returned 1 exit status


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
@ 2012-03-10  7:51 ` pinskia at gcc dot gnu.org
  2012-07-23 14:47 ` oeste.sebastian at googlemail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-03-10  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end
           Severity|major                       |normal


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
  2012-03-10  7:51 ` [Bug middle-end/52544] " pinskia at gcc dot gnu.org
@ 2012-07-23 14:47 ` oeste.sebastian at googlemail dot com
  2012-07-23 14:50 ` oeste.sebastian at googlemail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oeste.sebastian at googlemail dot com @ 2012-07-23 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from sebastian <oeste.sebastian at googlemail dot com> 2012-07-23 14:47:00 UTC ---
Created attachment 27859
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27859
preprocessed minimal reproduction of the bug


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
  2012-03-10  7:51 ` [Bug middle-end/52544] " pinskia at gcc dot gnu.org
  2012-07-23 14:47 ` oeste.sebastian at googlemail dot com
@ 2012-07-23 14:50 ` oeste.sebastian at googlemail dot com
  2012-07-24  9:30 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oeste.sebastian at googlemail dot com @ 2012-07-23 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

sebastian <oeste.sebastian at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |oeste.sebastian at
                   |                            |googlemail dot com

--- Comment #2 from sebastian <oeste.sebastian at googlemail dot com> 2012-07-23 14:49:46 UTC ---
I've make a similar observation, with the function __mm_xor_si128 from
emmintrin.h and the flag -finstrument-functions. 

gcc Version 4.7.0 (same results with 4.7.1)

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/oeste/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/home/oeste/gcc/
Thread model: posix
gcc version 4.7.0 (GCC) 


$ gcc -Wall -Wextra -fno-strict-aliasing -fwrapv -save-temps
-finstrument-functions ./test.c 
test.o: In function `main':
test.c:(.text+0x50): undefined reference to `_mm_xor_si128'
test.c:(.text+0x61): undefined reference to `_mm_xor_si128'
collect2: error: ld returned 1 exit status

When compile without -finstrument-functions all will be done.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
                   ` (2 preceding siblings ...)
  2012-07-23 14:50 ` oeste.sebastian at googlemail dot com
@ 2012-07-24  9:30 ` rguenth at gcc dot gnu.org
  2013-06-28 13:45 ` rodrigo at sdfg dot com.ar
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-24  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-07-24
                 CC|                            |hubicka at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-24 09:30:14 UTC ---
Confirmed.  It's because we instrument before inlining always-inline functions
and get calls like

  __cyg_profile_func_enter (_mm_set1_ps, return_addr.3_22);

but of course no body for _mm_set1_ps function exists (not should it, IMHO).
We do the instrumentation during gimplification.

Honza, why does the address-taking of _mm_set1_ps not force its body
to be output?  Is there a predicate we can check that tells us wheter
a function body will forcefully _not_ be output?  Add that to

void
gimplify_function_tree (tree fndecl)
{
...
  /* If we're instrumenting function entry/exit, then prepend the call to
     the entry hook and wrap the whole function in a TRY_FINALLY_EXPR to
     catch the exit hook.  */
  /* ??? Add some way to ignore exceptions for this TFE.  */
  if (flag_instrument_function_entry_exit
      && !DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl)
      && !flag_instrument_functions_exclude_p (fndecl))
    {


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
                   ` (3 preceding siblings ...)
  2012-07-24  9:30 ` rguenth at gcc dot gnu.org
@ 2013-06-28 13:45 ` rodrigo at sdfg dot com.ar
  2013-06-28 15:25 ` rodrigo at sdfg dot com.ar
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rodrigo at sdfg dot com.ar @ 2013-06-28 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

Rodrigo Campos <rodrigo at sdfg dot com.ar> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rodrigo at sdfg dot com.ar

--- Comment #4 from Rodrigo Campos <rodrigo at sdfg dot com.ar> ---
I think I'm hitting a similar issue, although not when using sse code in my
case.

I'm working on a (shared) library that uses P99: http://p99.gforge.inria.fr/. I
just use it as a git submodule on commit 59e08b2, so not linking nor anything
"wierd" there, just as it was part of my source code.

When I compile the shared library, of course, no error is thrown. But when I
try to link agains it, the same "undefined reference to" error to a bunch of
P99 functions. For example something like this is shown:

./liborwl.so: undefined reference to `mtx_lock'
./liborwl.so: undefined reference to `p99_count_destroy'
./liborwl.so: undefined reference to `p99_rand'


Lot of them, I didn't check all, have the "always_inline". And some also have
the "warn_unused_result" gcc attribute or something else.

Also, I'm using gcc 4.7.2 (in debian stable). If I use gcc 4.5 the code
compiles and link okay, but when I run the executable it seems there is a
memory corruption and nothing works as expected.

Is this "-finstrument-function" flag still supported ?




Thanks a lot,
Rodrigo


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
                   ` (4 preceding siblings ...)
  2013-06-28 13:45 ` rodrigo at sdfg dot com.ar
@ 2013-06-28 15:25 ` rodrigo at sdfg dot com.ar
  2013-08-13  8:17 ` rodrigo at sdfg dot com.ar
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rodrigo at sdfg dot com.ar @ 2013-06-28 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Rodrigo Campos <rodrigo at sdfg dot com.ar> ---
Ohh, forgot to say, but if I just don't compile with "-finstrument-functions"
the code works as expected. With gcc 4.7, 4.5 and 4.4.

Although, when I compile with gcc 4.5 and 4.4, everything compiles and links.
But if my instrument function does a printf, I get a memory corruption:

void __cyg_profile_func_enter(void *func,  void *caller)
{
  printf("just printing something\n");
  return;
}


void __cyg_profile_func_exit(void *func,  void *caller)
{
  return;
}

If I just remove the call to printf and leave a "return;" it seems to work
(althoug not sure if optimized out, didn't check the assembly). Also, if I just
add an integer, it seems to work okay. I tried creating a big array on the
stack and see if I saw memory corruption, but I didnt. I tried this:

int dummy;

void __cyg_profile_func_enter(void *func,  void *caller)
{
  //printf("just printing something\n");
  dummy++;
  int a = 0;
  a++;
  int array[1000];
  for (int i = 0; i < 1000; i++)
    array[i] = 3;

  return;
}


void __cyg_profile_func_exit(void *func,  void *caller)
{
  //printf("just printing something\n");
  dummy--;
  int a = 0;
  a++;
  int array[1000];
  for (int i = 0; i < 1000; i++)
    array[i] = 3;

  return;
}

So, for some reason, it doesn't like a printf there (there are various threads
in the program, I tried just in case serializing printf calls with a mutex but
it didn't help). Also, if I use a macro in my library that uses snprintf in the
end to print something, it corrupts the memory too.

Ohh, also, it doesn't matter if the call to printf is in the "_enter" or
"_exit" function, it always seems to corrupt the memory.


So, to sum up, it seems that with recent versions of gcc (as reported in the
original bug report) it doesn't compile the sse code in the original bugreport
and it doesn't compile some other type of functions. These kind of functions
seems to be used in P99 (link to the project in my previous post) and some are
marked as "always_inline" and "warn_unused_result".

Also, gcc 4.5 and 4.4 seem to compile these kind of functions used in P99 just
fine, but when putting a printf/snprintf in the "__cyg_profile*" functions
there is a memmory corruption.


With all gcc versions, when compiling without "-finstrument-functions" it works
just fine (and it seems valgrind doesn't find anything wrong either).



If you want me to try/test something, or if I can help in any way, please let
me know :)



Thanks a lot,
Rodrigo


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
                   ` (5 preceding siblings ...)
  2013-06-28 15:25 ` rodrigo at sdfg dot com.ar
@ 2013-08-13  8:17 ` rodrigo at sdfg dot com.ar
  2014-12-20 14:44 ` mobi at mobiphil dot com
  2014-12-20 14:58 ` mobi at mobiphil dot com
  8 siblings, 0 replies; 10+ messages in thread
From: rodrigo at sdfg dot com.ar @ 2013-08-13  8:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Rodrigo Campos <rodrigo at sdfg dot com.ar> ---
Actually, I recently find out that the memory corruption thing was not a GCC
bug. It was a really weird error that only appears in the library if you do a
print to stdout (not stderr) before some thing happens. And when I added a
print compiling without -finstrument-functions, I did not added at the **very**
beginning (but after some other thing, if not you will not hit the bug) and
when compiling with "-finstrument-functions" it was added there. So I did not
hit this weird bug when I tried to :)

So I'm just hitting the bug originally reported with the same symptoms, sorry
for the noise!


If I can help in any way, please let me know :-)



Thanks a lot,
Rodrigo


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
                   ` (6 preceding siblings ...)
  2013-08-13  8:17 ` rodrigo at sdfg dot com.ar
@ 2014-12-20 14:44 ` mobi at mobiphil dot com
  2014-12-20 14:58 ` mobi at mobiphil dot com
  8 siblings, 0 replies; 10+ messages in thread
From: mobi at mobiphil dot com @ 2014-12-20 14:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52544

mobi at mobiphil dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mobi at mobiphil dot com

--- Comment #7 from mobi at mobiphil dot com ---
Hi, I run into the same issue. Strange enough few days ago some similar
construct was working, that is I could use -finstrument-functions. (Do not
remember, if I did some package update on the ubuntu workstation I work). Now
for a simple program:

#include <emmintrin.h>


void setbytes(char *p, int c)
{
  __m128i i = _mm_set_epi8(c, c, c, c,
                           c, c, c, c,
                           c, c, c, c,
                           c, c, c, c);
  _mm_stream_si128((__m128i *)&p[0], i);
  _mm_stream_si128((__m128i *)&p[16], i);
  _mm_stream_si128((__m128i *)&p[32], i);
  _mm_stream_si128((__m128i *)&p[48], i);
}


char cucu[1000];
int main()
{

   setbytes(cucu, 3);
}

->gcc t.c -finstrument-functions
/tmp/ccDMgc7s.o:t.c:function setbytes: error: undefined reference to
'_mm_set_epi8'
/tmp/ccDMgc7s.o:t.c:function setbytes: error: undefined reference to
'_mm_set_epi8'
/tmp/ccDMgc7s.o:t.c:function setbytes: error: undefined reference to
'_mm_stream_si128'
/tmp/ccDMgc7s.o:t.c:function setbytes: error: undefined reference to
'_mm_stream_si128'
/tmp/ccDMgc7s.o:t.c:function setbytes: error: undefined reference to
'_mm_stream_si128'
/tmp/ccDMgc7s.o:t.c:function setbytes: error: undefined reference to
'_mm_stream_si128'
collect2: error: ld returned 1 exit status


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug middle-end/52544] compilation fails with -finstrument-functions and sse c code
  2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
                   ` (7 preceding siblings ...)
  2014-12-20 14:44 ` mobi at mobiphil dot com
@ 2014-12-20 14:58 ` mobi at mobiphil dot com
  8 siblings, 0 replies; 10+ messages in thread
From: mobi at mobiphil dot com @ 2014-12-20 14:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52544

--- Comment #8 from mobi at mobiphil dot com ---
forgot to mention:

gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
Ubuntu 14.04 LTS _Trusty Tahr_ - Release amd64
Linux 3.16.0-25-lowlatency


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-20 14:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-09 17:30 [Bug c/52544] New: compilation fails with -finstrument-functions and sse c code jgpiccinali at free dot fr
2012-03-10  7:51 ` [Bug middle-end/52544] " pinskia at gcc dot gnu.org
2012-07-23 14:47 ` oeste.sebastian at googlemail dot com
2012-07-23 14:50 ` oeste.sebastian at googlemail dot com
2012-07-24  9:30 ` rguenth at gcc dot gnu.org
2013-06-28 13:45 ` rodrigo at sdfg dot com.ar
2013-06-28 15:25 ` rodrigo at sdfg dot com.ar
2013-08-13  8:17 ` rodrigo at sdfg dot com.ar
2014-12-20 14:44 ` mobi at mobiphil dot com
2014-12-20 14:58 ` mobi at mobiphil dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).