public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113122] New: Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel
@ 2023-12-23 10:51 zsojka at seznam dot cz
  2024-01-17 16:13 ` [Bug target/113122] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2023-12-23 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113122
           Summary: Assembler messages: Error: operand type mismatch for
                    `movabs' / bad expression / invalid use of register
                    with -fprofile -mcmodel=large -masm=intel
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: assemble-failure
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Compiler output:
$ echo 'void foo(void) {}' > testcase.c
$ x86_64-pc-linux-gnu-gcc -fprofile -mcmodel=large -masm=intel testcase.c
-save-temps
a-testcase.s: Assembler messages:
a-testcase.s:14: Error: operand type mismatch for `movabs'
a-testcase.s:15: Error: bad expression
a-testcase.s:15: Error: invalid use of register

$ cat a-testcase.s 
...
1:      movabsq $mcount, %r10
        call    *%r10
...


It seems the Intel dialect variant is missing for generation of this statement.

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

* [Bug target/113122] Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel
  2023-12-23 10:51 [Bug target/113122] New: Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel zsojka at seznam dot cz
@ 2024-01-17 16:13 ` jakub at gcc dot gnu.org
  2024-01-18  9:22 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-17 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2024-01-17

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 57115
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57115&action=edit
gcc14-pr113122.patch

Untested fix.

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

* [Bug target/113122] Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel
  2023-12-23 10:51 [Bug target/113122] New: Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel zsojka at seznam dot cz
  2024-01-17 16:13 ` [Bug target/113122] " jakub at gcc dot gnu.org
@ 2024-01-18  9:22 ` cvs-commit at gcc dot gnu.org
  2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-18  9:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:d4a2d91b46b2cf758b249a4545e34287e90da23b

commit r14-8214-gd4a2d91b46b2cf758b249a4545e34287e90da23b
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jan 18 10:21:12 2024 +0100

    i386: Add -masm=intel profiling support [PR113122]

    x86_function_profiler emits assembly directly into file and only emits
    AT&T syntax.  The following patch adjusts it to emit MASM syntax
    if -masm=intel.
    As it doesn't use asm_fprintf, I can't use {|} syntax for the dialects.

    I've tested using
    for i in -mcmodel=large "-mcmodel=large -fpic" "" -fpic "-m32 -fpic"
"-m32"; do
    ./xgcc -B ./ -c -O2 -fprofile $i -masm=att pr113122.c -o pr113122.o1;
    ./xgcc -B ./ -c -O2 -fprofile $i -masm=intel pr113122.c -o pr113122.o2;
    objdump -dr pr113122.o1 > /tmp/1; objdump -dr pr113122.o2 > /tmp/2;
    diff -up /tmp/1 /tmp/2; done
    that the emitted sequences are identical after assembly.

    2024-01-18  Jakub Jelinek  <jakub@redhat.com>

            PR target/113122
            * config/i386/i386.cc (x86_function_profiler): Add -masm=intel
            support.  Add missing space after , in emitted assembly in some
            cases.  Formatting fixes.

            * gcc.target/i386/pr113122-1.c: New test.
            * gcc.target/i386/pr113122-2.c: New test.
            * gcc.target/i386/pr113122-3.c: New test.
            * gcc.target/i386/pr113122-4.c: New test.

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

* [Bug target/113122] Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel
  2023-12-23 10:51 [Bug target/113122] New: Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel zsojka at seznam dot cz
  2024-01-17 16:13 ` [Bug target/113122] " jakub at gcc dot gnu.org
  2024-01-18  9:22 ` cvs-commit at gcc dot gnu.org
@ 2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
  2024-03-04 12:07 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-02  0:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:8b2a4022af095d1e4fadc2489d4b9ea13966ec5c

commit r13-8384-g8b2a4022af095d1e4fadc2489d4b9ea13966ec5c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jan 18 10:21:12 2024 +0100

    i386: Add -masm=intel profiling support [PR113122]

    x86_function_profiler emits assembly directly into file and only emits
    AT&T syntax.  The following patch adjusts it to emit MASM syntax
    if -masm=intel.
    As it doesn't use asm_fprintf, I can't use {|} syntax for the dialects.

    I've tested using
    for i in -mcmodel=large "-mcmodel=large -fpic" "" -fpic "-m32 -fpic"
"-m32"; do
    ./xgcc -B ./ -c -O2 -fprofile $i -masm=att pr113122.c -o pr113122.o1;
    ./xgcc -B ./ -c -O2 -fprofile $i -masm=intel pr113122.c -o pr113122.o2;
    objdump -dr pr113122.o1 > /tmp/1; objdump -dr pr113122.o2 > /tmp/2;
    diff -up /tmp/1 /tmp/2; done
    that the emitted sequences are identical after assembly.

    2024-01-18  Jakub Jelinek  <jakub@redhat.com>

            PR target/113122
            * config/i386/i386.cc (x86_function_profiler): Add -masm=intel
            support.  Add missing space after , in emitted assembly in some
            cases.  Formatting fixes.

            * gcc.target/i386/pr113122-1.c: New test.
            * gcc.target/i386/pr113122-2.c: New test.
            * gcc.target/i386/pr113122-3.c: New test.
            * gcc.target/i386/pr113122-4.c: New test.

    (cherry picked from commit d4a2d91b46b2cf758b249a4545e34287e90da23b)

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

* [Bug target/113122] Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel
  2023-12-23 10:51 [Bug target/113122] New: Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
@ 2024-03-04 12:07 ` jakub at gcc dot gnu.org
  2024-06-11 10:36 ` cvs-commit at gcc dot gnu.org
  2024-06-11 10:49 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-04 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be now fixed for GCC 14 and GCC 13.3+ too.

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

* [Bug target/113122] Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel
  2023-12-23 10:51 [Bug target/113122] New: Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2024-03-04 12:07 ` jakub at gcc dot gnu.org
@ 2024-06-11 10:36 ` cvs-commit at gcc dot gnu.org
  2024-06-11 10:49 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-11 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:bc512822220bea76a382875da36e45ebb265b8c0

commit r12-10507-gbc512822220bea76a382875da36e45ebb265b8c0
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jan 18 10:21:12 2024 +0100

    i386: Add -masm=intel profiling support [PR113122]

    x86_function_profiler emits assembly directly into file and only emits
    AT&T syntax.  The following patch adjusts it to emit MASM syntax
    if -masm=intel.
    As it doesn't use asm_fprintf, I can't use {|} syntax for the dialects.

    I've tested using
    for i in -mcmodel=large "-mcmodel=large -fpic" "" -fpic "-m32 -fpic"
"-m32"; do
    ./xgcc -B ./ -c -O2 -fprofile $i -masm=att pr113122.c -o pr113122.o1;
    ./xgcc -B ./ -c -O2 -fprofile $i -masm=intel pr113122.c -o pr113122.o2;
    objdump -dr pr113122.o1 > /tmp/1; objdump -dr pr113122.o2 > /tmp/2;
    diff -up /tmp/1 /tmp/2; done
    that the emitted sequences are identical after assembly.

    2024-01-18  Jakub Jelinek  <jakub@redhat.com>

            PR target/113122
            * config/i386/i386.cc (x86_function_profiler): Add -masm=intel
            support.  Add missing space after , in emitted assembly in some
            cases.  Formatting fixes.

            * gcc.target/i386/pr113122-1.c: New test.
            * gcc.target/i386/pr113122-2.c: New test.
            * gcc.target/i386/pr113122-3.c: New test.
            * gcc.target/i386/pr113122-4.c: New test.

    (cherry picked from commit d4a2d91b46b2cf758b249a4545e34287e90da23b)

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

* [Bug target/113122] Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel
  2023-12-23 10:51 [Bug target/113122] New: Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2024-06-11 10:36 ` cvs-commit at gcc dot gnu.org
@ 2024-06-11 10:49 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-06-11 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed for 12.4+ too.

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

end of thread, other threads:[~2024-06-11 10:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-23 10:51 [Bug target/113122] New: Assembler messages: Error: operand type mismatch for `movabs' / bad expression / invalid use of register with -fprofile -mcmodel=large -masm=intel zsojka at seznam dot cz
2024-01-17 16:13 ` [Bug target/113122] " jakub at gcc dot gnu.org
2024-01-18  9:22 ` cvs-commit at gcc dot gnu.org
2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
2024-03-04 12:07 ` jakub at gcc dot gnu.org
2024-06-11 10:36 ` cvs-commit at gcc dot gnu.org
2024-06-11 10:49 ` jakub at gcc dot gnu.org

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).