All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 944753] Re: ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug
  2012-03-02 12:25 [Qemu-devel] [Bug 944753] [NEW] ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug Oleksiy Bondarenko
@ 2012-03-02 12:25 ` Oleksiy Bondarenko
  2012-03-02 12:45 ` Peter Maydell
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Oleksiy Bondarenko @ 2012-03-02 12:25 UTC (permalink / raw)
  To: qemu-devel

** Attachment added: "qemu gcc 4.6.1 bug.pdf"
   https://bugs.launchpad.net/bugs/944753/+attachment/2800876/+files/qemu%20gcc%204.6.1%20bug.pdf

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/944753

Title:
  ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw
  4.6.1 bug

Status in QEMU:
  New

Bug description:
  Just want to warn anyone who hacks QEMU cortex M support under MinGW,
  it seems there is a bug in gcc 4.6.1 that compiles this peace of code
  wrong.

  translate.c:

               if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                 /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  if we just switch conditions order it will compile OK

                if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  I have attached gdb disassembly in the attachment for both cases

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/944753/+subscriptions

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

* [Qemu-devel] [Bug 944753] [NEW] ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug
@ 2012-03-02 12:25 Oleksiy Bondarenko
  2012-03-02 12:25 ` [Qemu-devel] [Bug 944753] " Oleksiy Bondarenko
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Oleksiy Bondarenko @ 2012-03-02 12:25 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Just want to warn anyone who hacks QEMU cortex M support under MinGW, it
seems there is a bug in gcc 4.6.1 that compiles this peace of code
wrong.

translate.c:

             if (IS_M(env)) {
                tmp = tcg_const_i32((insn & (1 << 4)) != 0);
               /* PRIMASK */
                if (insn & 2) {
                    addr = tcg_const_i32(16);
                    gen_helper_v7m_msr(cpu_env, addr, tmp);
                    tcg_temp_free_i32(addr);
                }
                /* FAULTMASK */
                if (insn & 1) {
                    addr = tcg_const_i32(17);
                    gen_helper_v7m_msr(cpu_env, addr, tmp);
                    tcg_temp_free_i32(addr);
                }
                tcg_temp_free_i32(tmp);
                gen_lookup_tb(s);

if we just switch conditions order it will compile OK

              if (IS_M(env)) {
                tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                /* FAULTMASK */
                if (insn & 1) {
                    addr = tcg_const_i32(17);
                    gen_helper_v7m_msr(cpu_env, addr, tmp);
                    tcg_temp_free_i32(addr);
                }
                /* PRIMASK */
                if (insn & 2) {
                    addr = tcg_const_i32(16);
                    gen_helper_v7m_msr(cpu_env, addr, tmp);
                    tcg_temp_free_i32(addr);
                }
                tcg_temp_free_i32(tmp);
                gen_lookup_tb(s);

I have attached gdb disassembly in the attachment for both cases

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: arm cortexm windows

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/944753

Title:
  ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw
  4.6.1 bug

Status in QEMU:
  New

Bug description:
  Just want to warn anyone who hacks QEMU cortex M support under MinGW,
  it seems there is a bug in gcc 4.6.1 that compiles this peace of code
  wrong.

  translate.c:

               if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                 /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  if we just switch conditions order it will compile OK

                if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  I have attached gdb disassembly in the attachment for both cases

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/944753/+subscriptions

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

* [Qemu-devel] [Bug 944753] Re: ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug
  2012-03-02 12:25 [Qemu-devel] [Bug 944753] [NEW] ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug Oleksiy Bondarenko
  2012-03-02 12:25 ` [Qemu-devel] [Bug 944753] " Oleksiy Bondarenko
@ 2012-03-02 12:45 ` Peter Maydell
  2012-03-02 12:50 ` Oleksiy Bondarenko
  2012-07-10 15:19 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2012-03-02 12:45 UTC (permalink / raw)
  To: qemu-devel

That generated code certainly looks fishy, but really you need to report
gcc bugs to the gcc folks, not us.

I see from your quoted fragments of source code that you're using a
version of QEMU which has a bug in its handling of PRIMASK/FAULTMASK
here, incidentally. Commit d3cb6e2b0 (January, not in a QEMU release
yet) fixes bug 913925 -- we were passing the wrong constant values.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/944753

Title:
  ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw
  4.6.1 bug

Status in QEMU:
  New

Bug description:
  Just want to warn anyone who hacks QEMU cortex M support under MinGW,
  it seems there is a bug in gcc 4.6.1 that compiles this peace of code
  wrong.

  translate.c:

               if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                 /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  if we just switch conditions order it will compile OK

                if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  I have attached gdb disassembly in the attachment for both cases

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/944753/+subscriptions

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

* [Qemu-devel] [Bug 944753] Re: ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug
  2012-03-02 12:25 [Qemu-devel] [Bug 944753] [NEW] ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug Oleksiy Bondarenko
  2012-03-02 12:25 ` [Qemu-devel] [Bug 944753] " Oleksiy Bondarenko
  2012-03-02 12:45 ` Peter Maydell
@ 2012-03-02 12:50 ` Oleksiy Bondarenko
  2012-07-10 15:19 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Oleksiy Bondarenko @ 2012-03-02 12:50 UTC (permalink / raw)
  To: qemu-devel

Yes, thanks. I have mentioned that too.

About:
       but really you need to report gcc bugs to the gcc folks, not us.

I sow in source code that there are workarounds for different compilers
bugs on different platforms.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/944753

Title:
  ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw
  4.6.1 bug

Status in QEMU:
  New

Bug description:
  Just want to warn anyone who hacks QEMU cortex M support under MinGW,
  it seems there is a bug in gcc 4.6.1 that compiles this peace of code
  wrong.

  translate.c:

               if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                 /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  if we just switch conditions order it will compile OK

                if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  I have attached gdb disassembly in the attachment for both cases

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/944753/+subscriptions

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

* [Qemu-devel] [Bug 944753] Re: ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug
  2012-03-02 12:25 [Qemu-devel] [Bug 944753] [NEW] ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug Oleksiy Bondarenko
                   ` (2 preceding siblings ...)
  2012-03-02 12:50 ` Oleksiy Bondarenko
@ 2012-07-10 15:19 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2012-07-10 15:19 UTC (permalink / raw)
  To: qemu-devel

This isn't a QEMU bug, and gcc 4.6.1 has fallen off the list of versions
gcc upstream still maintains, so I'm afraid I'm closing it as invalid. I
suggest you upgrade to a newer version of gcc...


** Changed in: qemu
       Status: New => Invalid

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/944753

Title:
  ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw
  4.6.1 bug

Status in QEMU:
  Invalid

Bug description:
  Just want to warn anyone who hacks QEMU cortex M support under MinGW,
  it seems there is a bug in gcc 4.6.1 that compiles this peace of code
  wrong.

  translate.c:

               if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                 /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  if we just switch conditions order it will compile OK

                if (IS_M(env)) {
                  tmp = tcg_const_i32((insn & (1 << 4)) != 0);
                  /* FAULTMASK */
                  if (insn & 1) {
                      addr = tcg_const_i32(17);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  /* PRIMASK */
                  if (insn & 2) {
                      addr = tcg_const_i32(16);
                      gen_helper_v7m_msr(cpu_env, addr, tmp);
                      tcg_temp_free_i32(addr);
                  }
                  tcg_temp_free_i32(tmp);
                  gen_lookup_tb(s);

  I have attached gdb disassembly in the attachment for both cases

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/944753/+subscriptions

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

end of thread, other threads:[~2012-07-10 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-02 12:25 [Qemu-devel] [Bug 944753] [NEW] ARM: CORTEX M, PRIMASK and FAULTMASK are misplaced, WINDOWS mingw 4.6.1 bug Oleksiy Bondarenko
2012-03-02 12:25 ` [Qemu-devel] [Bug 944753] " Oleksiy Bondarenko
2012-03-02 12:45 ` Peter Maydell
2012-03-02 12:50 ` Oleksiy Bondarenko
2012-07-10 15:19 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.